-1

I launched Amazon Linux instance and I am using a default security group with following settings:

Type:All traffic
Protocol:All
Port Range:All

But when connecting through ssh from my Mac I get Operation Timed Out message:

ssh -i "<key in double quotes>" ec2-user@<>.amazonaws.com

result in

ssh: connect to host <>.amazonaws.com port 22: Operation timed out

I am not sure what could be the reason. Can someone please help?

deejay217
  • 109
  • 2
  • 10
  • Have you _ever_ managed to SSH into an EC2 instance from the same network? Can you SSH into an instance that is in a different VPC/Subnet? – John Rotenstein Feb 27 '19 at 21:51

1 Answers1

2

A time-out normally indicates there is no network connectivity to the remote computer. A simple rule-of-thumb is:

  • If the error comes back immediately, then the SSH request has been rejected by the remote computer
  • If the error takes some time to come back (eg 5+ seconds), then it never reached the remote computer

Some potential causes:

  • Something else is blocking the access, such as a corporate firewall. Try from a different network (eg home, work, tether via your phone) to try and diagnose this situation.
  • The instance might be in a private subnet
  • The instance might be in a subnet that is incorrectly configured (eg not routing to an Internet Gateway to make a 'Public' subnet)
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470