简体   繁体   English

EC2的PuTTy连接超时

[英]PuTTy Connection timed out for EC2

I created Ubuntu instance in EC2. 我在EC2中创建了Ubuntu实例。 And worked fine so far. 到目前为止工作还不错。

But somehow I can't connect to the server by PuTTy anymore and I get Network error: Connection timed out . 但是由于某种原因,我无法再通过PuTTy连接到服务器,并且出现Network error: Connection timed out

  1. The instance is running in the console. 该实例正在控制台中运行。
  2. CPU uses just 2%. CPU仅使用2%。
  3. InBound Setting seems no problem. InBound设置似乎没有问题。 SSH with 22 port. 带有22端口的SSH。
  4. Tried with the IP address and DNS. 尝试使用IP地址和DNS。
  5. restarted the instance and Tried. 重新启动实例并尝试。
  6. Stopped and tried with different IP address. 已停止并尝试使用其他IP地址。
  7. Instance connection is fine. 实例连接很好。

This is the screenshot: 这是屏幕截图:

在此输入图像描述

This is inbound rule: 这是入站规则:

在此输入图像描述

How can I solve this problem? 我怎么解决这个问题?

A Connection timeout is a sign that your computer is unable reach the remote computer. 连接超时表示您的计算机无法访问远程计算机。 Such an error normally takes some time before it fails. 这样的错误通常需要一段时间才能失败。

If, instead, the remote computer rejected the connection, the error would appear immediately and the message would be Permission denied . 相反,如果远程计算机拒绝了该连接,则该错误将立即出现,并且该消息将为Permission denied

Things to check: 要检查的事项:

  • The Security Group on the EC2 instance needs to allow inbound SSH (port 22) access either from the whole internet ( 0.0.0.0/0 ) or, preferably, from a smaller CIDR range that includes your computer (eg choosing "My IP" in the console). EC2实例上的安全组需要允许从整个Internet( 0.0.0.0/0 ),或者最好从包含您的计算机的较小CIDR范围(例如,在Internet中选择“我的IP”)访问入站SSH(端口22)控制台)。 This is typically the cause of the issue 80% of the time. 这通常是80%的时间导致此问题的原因。
  • The instance needs to be in a Public Subnet , which means the subnet is connected to an Internet Gateway. 该实例必须位于“ 公共子网”中 ,这意味着该子网已连接到Internet网关。
  • Your network must allow an outbound SSH connection to AWS. 您的网络必须允许与AWS 的出站SSH连接 Some corporate networks might block this. 一些公司网络可能会阻止此操作。
  • There are some other potential causes, but most of the time the cause is one of the above. 还有其他一些可能的原因,但是在大多数情况下,原因是上述原因之一。

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

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