Ubuntu – Having trouble ssh into ec2 instance with elastic ip address

amazon ec2amazon-elastic-ipsshUbuntuvpn

I have a new ubuntu EC2 micro instance in a VPN with what i think should be access from the outside world to ssh.

$ ssh -i ./sendy.pem ubuntu@52.5.229.252

ssh: connect to host 52.5.229.252 port 22: Operation timed out

One thing that looks wrong to me is the elastic ip address. It doesn't have a "Public DNS", but I don't see a way to change that.

Elastic IP   | Instance           | Private IP Address | Scope        | Public DNS
52.5.229.252 | i-47260e68 (Sendy) | 10.91.1.51         | vpc-16e2c673 |

I'm stuck, and not sure what to do.



EC2 Instance

Some fields that seem important (happy to provide more):

  • Instance ID – i-47260e68
  • AMI ID – ubuntu-trusty-14.04-amd64-server-20150325 (ami-d05e75b8)
  • Public IP – 52.5.229.252
  • VPC ID – vpc-16e2c673
  • Instance state – running
  • Key pair name – sendy

Private Key

$ cat sendy.pem | head -n 1

-----BEGIN RSA PRIVATE KEY-----

Security Group

Name         | Group ID    | Group Name   | VPC ID       | Description
sendy-server | sg-6feea80b | sendy-server | vpc-16e2c673 | Sendy Web Server

Inbound rules include:

Type | Protocol | Port Range | Source
SSH  | TCP      | 22         | 0.0.0.0/0

Happy to provide more.

Best Answer

Three possibilities:

  1. Your VPC route table for the subnet is missing an entry pointing 0.0.0.0/0 to the IGW
  2. Your instance was launched into the default or wrong security group that is missing the incoming ssh rule
  3. You have a NACL on the subnet that is blocking the traffic