本文介绍了即使已经设置了端口22,如何连接到SSH EC2 Amazon的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使将端口22设置为任意位置,在与EC2的ssh连接上仍然出现超时错误,我看到了我的用户,并且确实是ec2-user,但是每次都收到超时消息

Im getting Timeout error on ssh connection to EC2 even after set port 22 to anywhere, i see my user and is ec2-user indeed but im getting timeout everytime

我已经尝试重新启动实例并更改为其他安全组,甚至尝试使用Termius软件(MAC上的im)代替命令行,但没有注意...

Im already tried reboot the instance and change to other security group, even try Termius software (im on MAC) instead command line but notheing...

推荐答案

首先,检查您的VPC和该VPC中创建实例的子网.该子网将具有一个路由表,请验证该子网是否已连接到目的地为0.0.0.0/0的Internet网关,否则请通过引用链接.发布此步骤后,检查您的安全组是否具有来自IP的端口22的入口规则(从下拉列表中选择my ip).如果正确配置了这两个步骤,您将不会得到Connection timeout error.

First of all, check you VPC and subnets inside this VPC in which you have created your instance. The subnet will have a route table, verify that subnet is attached to an Internet Gateway with Destination 0.0.0.0/0, otherwise add one by referring this link. Post this step, check that your security group has an Ingress Rule for port 22 from your ip(select my ip from drop down). You will not get Connection timeout error if these two steps are configured properly.

这篇关于即使已经设置了端口22,如何连接到SSH EC2 Amazon的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 19:49