简体   繁体   English

AWS EC2 SSh超时

[英]AWS EC2 SSh Timeout

I cannot seem to connect to my ec2 instances anymore. 我似乎无法再连接到ec2实例。

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. 我能够在第一个实例中使用ssh,但是它刚刚停止工作。 Furthermore, I have tried to ssh from two separate computers, also with no luck. 此外,我尝试从两台单独的计算机上进行ssh操作,也没有运气。

Short of signing up for another AWS account I am out of things to try, Anybody have any ideas? 缺少注册另一个AWS账户的机会我没办法尝试,有人有什么想法吗?

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 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. 1)在VPC中检查您的NACL。

2) Check your route table has a internet-gateway. 2)检查您的路由表是否具有Internet网关。

3) Check if your subnet is attached with the same route table(with IGW). 3)检查您的子网是否附有相同的路由表(带有IGW)。

4) Check your INBOUND Security Group (port 22 ssh if LINUX or RDP 3309 for Windows) to EC2 Instances. 4)检查您的INBOUND安全组(对于Windows为LINUX或RDP 3309,端口22 ssh)至EC2实例。 (Open SSH Inbound). (打开SSH入站)。

5) If your EC2 is in private subnet. 5)如果您的EC2在专用子网中。 Add a NAT Gateway in VPC and attach it to the route table to allow connection from Internet(0.0.0.0/0). 在VPC中添加NAT网关并将其附加到路由表,以允许来自Internet(0.0.0.0/0)的连接。

6) Now SSH into your EC2 Instance (if Linux) or RDP (if windows) 6)现在,SSH进入您的EC2实例(如果是Linux)或RDP(如果是Windows)

Note: Convert your pem file to ppk file if using Putty. 注意:如果使用腻子,请将您的pem文件转换为ppk文件。 For windows generate your password using pem in AWS console. 对于Windows,请在AWS控制台中使用pem生成密码。

For Linux: Usernames for different Flavours: amazon linux: ec2-user 对于Linux:不同风味的用户名:amazon linux:ec2-user

ubuntu: ubuntu ubuntu:ubuntu

Centos: ec2-user/centos Centos:ec2-user / centos

Redhat: ec2-user/root Redhat:ec2-用户/ root

Debian: admin/root/ec2-user 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 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. AWS支持拒绝调查我的案件,因为我没有帐户上的技术支持计划。 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 此问题也在论坛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. 我遇到了同样的问题,找到了解决方案,我用默认,路由表和IGW设置了SG端口22。 I checked my Security layer on Xfinity (my internet provider). 我在Xfinity(我的互联网提供商)上检查了我的安全层。 The Firewall setting has High Security where it was blocking all except few and SSH was one of them to be blocked. 防火墙设置具有“高安全性”,在此设置中,除少数安全设置外,其他所有功能都被阻止,而SSH是其中之一。 I changed it to Medium where it is allowing all and blocking few.. After I changed, I was able to ssh successfully. 我将其更改为允许所有内容并阻止少量内容的Medium。更改后,我能够成功ssh。 it took me 5 hours to resolve.. Great learning. 我花了5个小时才解决。.很棒的学习。 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. 如果您已经使用SSH端口22正确设置了SG,并且路由和IGS应该按照上述说明正确,则希望这能解决您的问题。 Enjoy AWS Cloud.. Happy Learning. 享受AWS Cloud ..祝您学习愉快。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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