ssh operation timed out

2

Hi, I am getting an error (ssh: connect to host ec2-35-154-20-103.ap-south-1.compute.amazonaws.com port 22: Operation timed out) when trying to ssh into EC2 instance.

Update: SOLVED! Details: Thankyou everyone for your quick help. My instance was running initially but it stopped running eventually. Maybe because I abruptly exited out of it (with ctrl +D). I tried deleting the instance and create a new one but it did't run. Now, I am running a new instance in a different region. This has solved the problem.

asked 2 years ago3351 views
3 Answers
0

Hi

First of all, I recommend you do not post the Machine IP address publicly it is not best practice. I understand that you are not able to connect Ec2 instance ssh,

Please verify below points :

  1. Check Your Ec2 instance is having **2/2 Health Check passed **
  2. Check Security Group of Ec2 instance port is allowed from your Source Ip , Security Group must allow inbound rule Port 22 to your IP or 0.0.0.0/0 , Link to add SG https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/authorizing-access-to-an-instance.html
  3. Check if your Subnet, If it is public check Internet Gateway attached to it, Link https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html
  4. Ping IP adress if you are able to ping the IP

General Information How to Connect to Ec2 instance ...!

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstances.html

If everything is Looks good, You should able to acess the Ec2 instance

profile picture
GK
answered 2 years ago
0

There are a few reasons why you might be getting this error, but the first thing to check is that the security group attached to the instance allows ingress traffic on port 22 from the IP address you're trying to connect from.

If that doesn't work, there are a few more solutions to try here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html#TroubleshootingInstancesConnectionTimeout

Ed
answered 2 years ago
0

To add to the other answers, using the VPC Reachability Analyzer (https://docs.aws.amazon.com/vpc/latest/reachability/what-is-reachability-analyzer.html) may be able to track down the reason that you are unable to connect to your ec2 instance.

AWS
bendutt
answered 2 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.

Guidelines for Answering Questions