无法通过SSH连接新创建的Ubuntu EC2实例。

0

【以下的问题经过翻译处理】 我从AWS控制台启动了一台Ubuntu EC2实例,并设置了安全规则允许SSH连接来自任何地方。我从“快速入门”菜单中选择了Ubuntu。

当我尝试通过SSH从我的笔记本连接到它时,连接超时,连接失败。我还尝试了AWS控制台上的“Instance Connect”按钮,但它告诉我实例无法连接。

我尝试像这样连接:

ssh -i "$HOME/.ssh/my-key.pem" ubuntu@<pulibc-ip-here>.ap-northeast-1.compute.amazonaws.com

我是否缺少任何配置或过程?

我刚刚按照半年前曾成功连接的方法进行了操作,所以我认为可能是AWS的认证方式发生了变化。

Enter image description here

profile picture
EXPERT
asked 5 months ago97 views
1 Answer
0

【以下的回答经过翻译处理】 请参考以下EC2用户指南中的故障排除信息 https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html

请参考有关“连接超时”的特定部分:https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html#TroubleshootingInstancesConnectionTimeout

您是否成功连接到此实例或半年前的另一个实例? 如果您曾经连接到此实例,您自上次连接以来是否停止并重新启动了实例? 当您停止实例后,自动分配给实例的公共IPv4地址会丢失。当您重新启动实例时,将分配新的公共IPv4地址。请检查您是否使用了正确的IP地址进行连接。

profile picture
EXPERT
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions