问题描述
我在亚马逊网络服务(AWS)创建亚马逊EC2的一个新实例通过的。我甚至增加这样的SSH规则:
I created a new instance of Amazon EC2 in Amazon Web Services (AWS) by referring to the documentation. I even added a SSH rule like this:
Port: 22
Type: SSH
Source: <My IP address>/32
我下载了质子交换膜
文件,转换成 .ppk
文件中使用 PuTTYGEN
。然后,我添加主机名腻子是这样的:
I downloaded the .pem
file, converted it into .ppk
file by using PuTTYGEN
. Then I added host name in PuTTY like this:
ec2-user@<public_DNS>
我选择了默认设置
补充说,登录.ppk文件腻子,我得到这个错误:
I selected default settings
, added that .ppk file to PuTTY, logged in and I got this error:
Even trouble shooting link didn't help me.
I'm also getting this error in system logs:
我如何通过腻子连接到我的Amazon EC2实例?
How can I connect to my Amazon EC2 instance via PuTTY?
推荐答案
检查事项尝试连接到Amazon EC2实例时:
Things to check when trying to connect to an Amazon EC2 instance:
- 安全组:确保安全组允许的入所需的端口访问(例如80,22),相应的IP地址范围(例如:
0.0.0.0/0
)。这解决了大部分问题。 - 公开IP地址:查看您正在使用该实例的正确的公网IP地址。如果实例停止和启动,它的也许的收到一个新的公网IP地址(具体取决于已配置)。
- VPC配置:访问是在一个虚拟私有云(VPC)需要推出一个EC2实例:
- 的互联网网关
- A 路由表子网连接到Internet网关
- NACLs (网络ACLS)通流量允许
- Security Group: Make sure the security group allows inbound access on the desired ports (eg 80, 22) for the appropriate IP address range (eg
0.0.0.0/0
). This solves the majority of problems. - Public IP Address: Check that you're using the correct Public IP address for the instance. If the instance is stopped and started, it might receive a new Public IP address (depending on how it has been configured).
- VPC Configuration: Accessing an EC2 instance that is launched inside a Virtual Private Cloud (VPC) requires:
- An Internet Gateway
- A routing table connecting the subnet to the Internet Gateway
- NACLs (Network ACLS) that permit through-traffic
如果您能够启动并连接到另一个实例在同一个子网,那么VPC配置似乎是正确的。
If you are able to launch and connect to another instance in the same subnet, then the VPC configuration would appear to be correct.
另外要检查将是实际的配置操作系统在该实例本身。某些软件可能会影响使Web服务器/ ssh守护进程运行不正常的配置。当然,这是很难确定无需连接到该实例。
The other thing to check would be the actual configuration of the operating system on the instance itself. Some software may be affecting the configuration so that the web server / ssh daemon is not working correctly. Of course, that is hard to determine without connecting to the instance.
如果您是从一个标准的Linux亚马逊的AMI启动,
SSH
将随时正常工作。该网站的服务器(端口80)将需要安装软件和配置上的实例,这是你的责任,以维护。If you are launching from a standard Amazon Linux AMI,
ssh
would work correctly anytime. The web server (port 80) would require installation and configuration of software on the instance, which is your responsibility to maintain.这篇关于无法通过腻子连接到Amazon EC2实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!