我有一个EC2实例,我已经运行了几个月。我通常能够连接到它,但通常在连接时会出现超时错误(大约每周2次)。我通常要么重新启动实例,要么停止并再次启动它。我为所有IP打开了端口22。
我已经浏览了AWS的故障排除指南和stackoverflow上的其他帖子,但无济于事。
为什么连接到EC2如此不可靠?这是我今天得到的“通过对等连接重置”错误的示例。重新启动实例后,它再次正常工作,但为什么我经常会出现超时错误?
非常感谢任何帮助!谢谢!
ssh -i "mykey.pem" ec2-user@ec2-XX-XXX-XX-XX.compute-1.amazonaws.com -v
-----
OpenSSH_7.5p1, LibreSSL 2.5.4
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 52: Applying options for *
debug1: Connecting to ec2-34-204-14-14.compute-1.amazonaws.com [34.204.14.14] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file crypto.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file crypto.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.5
ssh_exchange_identification: read: Connection reset by peer