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.

已提問 2 年前檢視次數 3426 次
3 個答案
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
已回答 2 年前
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
已回答 2 年前
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
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南