简体   繁体   中英

AWS EC2 SSh Timeout

I cannot seem to connect to my ec2 instances anymore.

To preface:

I have even destroyed my instance and created a whole new one with no luck. I was able ssh in with my first instance, then it just stopped working. Furthermore, I have tried to ssh from two separate computers, also with no luck.

Short of signing up for another AWS account I am out of things to try, Anybody have any ideas?

SOLUTION:
Turns out my account was in isolation mode.. My account was suspended a while ago but I had it lifted. After seeing this post:

https://serverfault.com/questions/778619/network-timeout-errors-with-amazon-ec2-instance-after-first-10-minutes

I reached out to amazon and had them check if I was in isolation . Turns out I was. Thank you for your help in the mean time.

Try troubleshooting from top level architecture.

1) Check your NACL in VPC.

2) Check your route table has a internet-gateway.

3) Check if your subnet is attached with the same route table(with IGW).

4) Check your INBOUND Security Group (port 22 ssh if LINUX or RDP 3309 for Windows) to EC2 Instances. (Open SSH Inbound).

5) If your EC2 is in private subnet. Add a NAT Gateway in VPC and attach it to the route table to allow connection from Internet(0.0.0.0/0).

6) Now SSH into your EC2 Instance (if Linux) or RDP (if windows)

Note: Convert your pem file to ppk file if using Putty. For windows generate your password using pem in AWS console.

For Linux: Usernames for different Flavours: amazon linux: ec2-user

ubuntu: ubuntu

Centos: ec2-user/centos

Redhat: ec2-user/root

Debian: admin/root/ec2-user

Turns out my account was in isolation mode.. My account was suspended a while ago but I had it lifted. After seeing this post:

https://serverfault.com/questions/778619/network-timeout-errors-with-amazon-ec2-instance-after-first-10-minutes

I reached out to amazon and had them check if I was in isolation. Turns out I was. Thank you for your help in the mean time.

I had same issue as well. I suspended my account a long while ago and recently had to reactivate.

AWS support refused to investiaget my case as i don't have technical support plan on account. So I had to delete account and create another one.

This issue was also tackled in the forum here https://forums.aws.amazon.com/thread.jspa?messageID=356632

I had the same issue, I found the solution, I had set up the SG port 22 with Default, Route Table and IGW was correct too. I checked my Security layer on Xfinity (my internet provider). The Firewall setting has High Security where it was blocking all except few and SSH was one of them to be blocked. I changed it to Medium where it is allowing all and blocking few.. After I changed, I was able to ssh successfully. it took me 5 hours to resolve.. Great learning. Hope this will solve yours, if you already have SG correctly set up with SSH port 22 and Route and IGS should be correct as per above comments. Enjoy AWS Cloud.. Happy Learning.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM