尝试通过SSH进入实例时关闭了AWS EC2 Connection [英] AWS EC2 Connection closed by when trying ssh into instance

查看:256
本文介绍了尝试通过SSH进入实例时关闭了AWS EC2 Connection的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我建立了一个新的EC2实例。第二天,我无法通过ssh连接到我的实例。我可以在前一天连接和断开连接,我确定自己什么也没做。这是ssh调试信息:

Recently I set up a new EC2 instance. The next day I was not able to connect to my instance via ssh. I could connect and disconnect the day before, I am sure I did nothing. Here is ssh debug info:

ssh -i webserver.pem -v ubuntu@my.elastic.ip
OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to my.elastic.ip [my.elastic.ip] port 22.
debug1: Connection established.
debug1: identity file webserver.pem type -1
debug1: identity file webserver.pem-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9
debug1: SSH2_MSG_KEXINIT sent
Connection closed by my.elastic.ip

已关闭连接解决此问题的方法?还是我应该重新安装实例?

Is there a way to resolve this issue? Or shall I reinstall my instance again?

.pem的PS权限设置为600。

PS rights to my .pem are set to 600.

推荐答案

检查您的安全组。确保您有一个允许流量从实例返回的出站规则。

Check your security group. Make sure that you have an outbound rule that allows traffic to return from the instance.

使用默认出站规则

type: All traffic, Protocol: All, Ports: All, Destination: 0.0.0.0/0

它将起作用。

这篇关于尝试通过SSH进入实例时关闭了AWS EC2 Connection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆