cannot connect to Ubuntu instance: Connection timed out

0

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 0.0.0.0:0.

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?

已提問 3 年前檢視次數 1277 次
2 個答案
0

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 0.0.0.0/0 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.

[1] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html#TroubleshootingInstancesConnectionTimeout

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

Thank you!
TL

已回答 3 年前
0

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.

已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南