观点差不多: 突然出现 ssh_exchange_identification:远程主机关闭连接
今天,2012 年 6 月 19 日,尝试通过 ssh 连接到与往常一样的主机,ssh 回复
ssh_exchange_identification: Connection closed by remote host
另外两次尝试都失败了
ssh -v $RWS
OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug1: Connecting to Real-World-Systems.com [174.127.119.33] port 22.
debug1: Connection established.
debug1: identity file /Users/dgerman/.ssh/id_rsa type 1
debug1: identity file /Users/dgerman/.ssh/id_rsa-cert type -1
debug1: identity file /Users/dgerman/.ssh/id_dsa type -1
debug1: identity file /Users/dgerman/.ssh/id_dsa-cert type -1
ssh_exchange_identification: Connection closed by remote host
ping 主机成功,
ftp 主机成功,
ssh 现在成功了,
ssh -v $RWS
OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug1: Connecting to Real-World-Systems.com [174.127.119.33] port 22.
debug1: Connection established.
debug1: identity file /Users/dgerman/.ssh/id_rsa type 1
debug1: identity file /Users/dgerman/.ssh/id_rsa-cert type -1
debug1: identity file /Users/dgerman/.ssh/id_dsa type -1
debug1: identity file /Users/dgerman/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH_4*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'real-world-systems.com' is known and matches the RSA host key.
debug1: Found key in /Users/dgerman/.ssh/known_hosts:5
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/dgerman/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Trying private key: /Users/dgerman/.ssh/id_dsa
debug1: Next authentication method: password
++++ 怎么回事?++++++++++++
Mac OS X 10.4.7、OpenSSH_5.6p1、OpenSSL 0.9.8r 2011 年 2 月 8 日,
/Users/dgerman/.ssh > ls -la
total 24
drwx------ 7 dgerman staff 238 Jun 19 15:46 .
drwxr-xr-x 389 dgerman staff 13226 Jun 19 15:46 ..
-rw------- 1 dgerman staff 1766 Feb 26 18:25 id_rsa
-rw-r--r-- 1 dgerman staff 400 Feb 26 18:25 id_rsa.pub
-rw-r--r-- 1 dgerman staff 67 Feb 26 18:27 keyfingerprint
-rw-r--r-- 1 dgerman staff 6215 May 1 08:11 known_hosts
-rw-r--r-- 1 dgerman staff 220 Feb 26 18:26 randomart
答案1
答案就在你链接的帖子里。很可能你暂时无法解决。但现在你可以再次使用 ssh,所以这个问题神奇地解决了。根据我的经验,许多这些奇怪的 ssh 问题都与某种解决问题有关。