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.

preguntada hace 2 años3423 visualizaciones
3 Respuestas
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
EXPERTO
GK
respondido hace 2 años
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
respondido hace 2 años
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
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas