0

I was trying to connect to AWS EC2 instance via my mac terminal, but it gives me the following connection reset error:

enter image description here

I was suspecting if it was an error associated with the security group and the elastic IP, but the config seems to be fine to me.

enter image description here

enter image description here

What could actually go wrong? Can someone look into it for me a bit? Thanks.

Danny Shen
  • 53
  • 4
  • Do you have a firewall on the instance, or are you trying to access it from behind a firewall? You might need to look into the firewall configuration if that's the case. – chamal Nov 24 '22 at 03:49
  • @chamal I actually try to connect to it via my company's laptop, and this is my private AWS account, so don't know if that is the issue. – Danny Shen Nov 24 '22 at 03:56
  • `Connection reset` normally indicates a network issue (nothing to do with AWS). Try it via a different network (eg home vs office vs tethered via your phone). – John Rotenstein Nov 24 '22 at 04:22
  • @JohnRotenstein I try it using my windows at home and it gives me permission denied error. I was wondering if I need to assign permission to pem file downloaded in my windows usin chmod command, but there is no chmod on windows. Do you know if there is a workaround on chmod? – Danny Shen Nov 24 '22 at 04:32
  • `Permission Denied` indicates that the ssh connection worked, but the server denied access -- typically due to an incorrect key. If you are using ssh from the command line you insert `-vvv` (eg `ssh -vvv -i key.pem ec2-user@IP`) to obtain debugging information. It should show why the provided keypair was rejected. Don't worry about chmod unless you receive a specific error about permissions on the key file provided. – John Rotenstein Nov 24 '22 at 04:35

1 Answers1

0

Could you check these two things in the associated subnet of the Elastic Network Interface to which elastic IP is attached:

  1. In Network ACL tab, confirm that the inbound and outbound rules of the network ACL allow traffic to your port or protocol.
  2. On the Route Table tab, confirm that you have a default route to an internet gateway to send traffic to the internet.

Refer to these articles for further help: