Skip to content

EC2 Instance ssh

1

Hello,

I am trying to ssh EC2 instance from GIT bash but getting the error "$ ssh -i "webserver-key.pem" ec2-user@ec2-18-216-146-49.us-east-2.compute.amazonaws.com ssh: connect to host ec2-18-216-146-49.us-east-2.compute.amazonaws.com port 22: Connection timed out"

Also I tried EC2 instance connect and got below error:-

Failed to connect to your instance EC2 Instance Connect is unable to connect to your instance. Ensure your instance network settings are configured correctly for EC2 Instance Connect. For more information, see Set up EC2 Instance Connect at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-set-up.html.

Thanks, Monica

asked 3 years ago692 views
2 Answers
0

I found my mistake so i followed the below steps:-

Download putty and puttygen, or the putty package and install it. Get the .pem file from your AWS EC2 instance. Use puttygen to convert the .pem file so that you'll have a private key --- mistake happened here. I chose "Conversions" tab from PuttyGen, and load my .pem file. After loading pem file, here DO NOT hit "Generate", instead directly "Save private key". That's the key you need. If you click Generate, you'll have a totally different pair of keys. In putty, use ec2-user@your.public.dns.that.you.get.from.aws.ec2.instance, and load the private key at SSH/Auth

Thanks,

answered 3 years ago
  • That's how I usually connect, but today suddenly I'm unable to connect using Putty with my preset saved connection

0

I'm having the exact same issue. Not sure why this is happening.

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.