EC2 SSH连接断开管道;无法重新连接

时间:2019-05-27 12:50:21

标签: amazon-web-services amazon-ec2 ssh

我已成功连接到EC2实例,如下所示:

ssh -i .ssh/ec2docker.cer user@SOMEIP

使用实例大约一个小时后,我离开并再返回两个小时:

$ packet_write_wait: Connection to xx port 22: Broken pipe

现在,当尝试连接时,什么也没有发生:

OpenSSH_7.9p1, OpenSSL 1.1.1b FIPS  26 Feb 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: /etc/ssh/ssh_config line 52: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0
debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
debug2: checking match for 'final all' host xxx originally xxx
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: not matched 'final'
debug2: match not found
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 (parse only)
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug3: gss kex names ok: [gss-gex-sha1-,gss-group14-sha1-,gss-group1-sha1-]
debug3: kex names ok: [curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1]
debug1: configuration requests final Match pass
debug1: re-parsing configuration
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: /etc/ssh/ssh_config line 52: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0
debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
debug2: checking match for 'final all' host xxx originally xxx
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: matched 'final'
debug2: match found
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug3: gss kex names ok: [gss-gex-sha1-,gss-group14-sha1-,gss-group1-sha1-]
debug3: kex names ok: [curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1]
debug2: resolving "xxxx" port 22
debug2: ssh_connect_direct
debug1: Connecting to xxx [xx] port 22.
debug1: Connection established.
debug1: identity file .ssh/ec2docker.cer type -1
debug1: identity file .ssh/ec2docker.cer-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9

ssh不会终止或给出错误。 EC2监视器显示实例正在以非零CPU使用率(大约25%)和非零网络读取和写入运行。

3 个答案:

答案 0 :(得分:0)

您是否已检查AWS中EC2的公共IP?

这似乎是重新启动,如果您没有“弹性IP”,那么您现在有了一个新的公共IP。

答案 1 :(得分:0)

管道断开意味着连接丢失

1)单击EC2-实例 2)点击连接 3)使用命令进行连接,它应该可以工作

答案 2 :(得分:0)

此问题的原因是我正在启动的应用程序中发生内存泄漏;它阻塞了整个EC2实例。