cannot connect to Ubuntu instance: Connection timed out


Having trouble accessing my Ubuntu instance (instance ID i-04558944a60f14055) with SSH. I've set it up as a t2.micro instance type, I've set up a security group that allows SSH/TCP access on port 22 for both my private IP address and

I've configured my keypair in Putty to allow access, but Putty simply tells me "Network error: Connection timed out". Similarly, if I just try a basic ping from my terminal to instance's public IP, I also get "Request timed out." I've made sure to test it with a fully disabled firewall to be sure that was not the issue.

Is there a problem with my account, or have I configured the instance wrong?

asked 2 years ago152 views
2 Answers

Hi there!

Thank you for posting your question of concern here.

Check your security group rules.
You need a security group rule that allows inbound traffic from your public IPv4 address on the proper port.

Note: Each time you restart your instance, a new IP address (and host name) will be assigned. If your security group has a rule that allows inbound traffic from a single IP address, this address might not be static if your computer is on a corporate network or if you are connecting through an internet service provider (ISP).

Check the route table for the subnet
You need a route that sends all traffic destined outside the VPC to the internet gateway for the VPC.

  • Verify that there is an internet gateway attached to your VPC. Otherwise, choose Create internet gateway.
  • On the Route table tab, verify that there is a route with as the destination and the internet gateway for your VPC as the target.

Check the network access control list (ACL) for the subnet.
The network ACLs must allow inbound and outbound traffic from your local IP address on the proper port. The default network ACL allows all inbound and outbound traffic.

Check that your instance has a public IPv4 address.

If not, you can associate an Elastic IP address with your instance.

And all the information above can be found in this documentation [1] which gives details on instance troubleshooting connecting, After verifying the above and find that you are missing one of the steps, then I will recommend that you follow this documentation for details on how to configure such.


I hope you will find this helpful, and if not, then you are more than welcome for further engagement.

Thank you!

answered 2 years ago

I looked through all and verified all of these points, but nothing seemed amiss. The next time I tried it, however, it worked. So, thanks for your help, though I'm not sure what it was that fixed it.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions