Ssh – AWS EC2 timeout connecting via SSH

amazon-web-servicessshtimeout

I've just started using Amazon's free trial, and followed the "Launch an Amazon EC2 Instance" guide to set up the t2.micro instance, but I'm having trouble connecting to it over SSH. I've set up the inbound rules for the Security Group as to allow SSH access from my local IP, and tried connecting over Putty and Cygwin+openssh, but both ways fail with a timeout error:

Output of ssh -vvv

$ ssh -i .ssh/aws-general.pem ubuntu@REDACTED.sa-east-1.compute.amazonaws.com -vvvvvvvv
OpenSSH_6.7p1, OpenSSL 1.0.1j 15 Oct 2014
debug2: ssh_connect: needpriv 0
debug1: Connecting to REDACTED.sa-east-1.compute.amazonaws.com [REDACTED] port 22.
debug1: connect to address REDACTED port 22: Connection timed out
ssh: connect to host REDACTED.sa-east-1.compute.amazonaws.com port 22: Connection timed out

How can I get SSH access to my instance?

EDIT: Tried connecting with the Java client and trough a Ubuntu machine, both time out the same way.

inbound rules: ssh: my ip http:anywhere https:anywhere
outbound rules: all traffic: anywhere

Best Answer

After some comment frenzy on the original question, we found the issue by following the AWS troubleshooting guide for timed out connections. This specific issue that @Kroltan had was caused by a missing route in the routing table. By adding a route in the VPC routing table for connecting the subnet with the internet gateway, the issue was resolved.

Related Topic