使用 ssh 连接从 wheezy 到 strech - 连接被服务器 IP 关闭

使用 ssh 连接从 wheezy 到 strech - 连接被服务器 IP 关闭

我有 2 台机器运行 Wheezy,3 台机器运行 Jessie,还有 2 台机器运行 Stretch。每次我尝试从 Wheezy(ssh 客户端)连接到 Stretch(ssh 服务器)时,都会出现错误,

Connection closed by <SERVER IP>

当我尝试从 Jessie(ssh 客户端)连接到 Stretch(ssh 服务器)时,不会发生这种情况。客户端和服务器没有 ip 表、没有防火墙和默认 ssh 配置。

当我尝试从两台 Wheezy 机器连接时,我收到相同的错误,

root@node1:/etc# ssh -vvv username@<server-ip>
OpenSSH_6.0p1 Debian-4+deb7u6, OpenSSL 1.0.1t  3 May 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to <server-ip> [<server-ip>] port 22.
debug1: Connection established.                                                                                     
debug1: permanently_set_uid: 0/0                                                                                    
debug1: identity file /root/.ssh/id_rsa type -1                                                                     
debug1: identity file /root/.ssh/id_rsa-cert type -1                                                                
debug1: identity file /root/.ssh/id_dsa type -1                                                                     
debug1: identity file /root/.ssh/id_dsa-cert type -1                                                                
debug1: identity file /root/.ssh/id_ecdsa type -1                                                                   
debug1: identity file /root/.ssh/id_ecdsa-cert type -1                                                              
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4p1 Debian-10                                
debug1: match: OpenSSH_7.4p1 Debian-10 pat OpenSSH*                                                                 
debug1: Enabling compatibility mode for protocol 2.0                                                                
debug1: Local version string SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u6                                                  
debug2: fd 3 setting O_NONBLOCK                                                                                     
debug3: put_host_port: [<server-ip>]:22                                                                           
debug3: load_hostkeys: loading entries for host "[<server-ip>]:22" from file "/root/.ssh/known_hosts"             
debug3: load_hostkeys: found key type ECDSA in file /root/.ssh/known_hosts:4                                        
debug3: load_hostkeys: loaded 1 keys                                                         
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug1: SSH2_MSG_KEXINIT sent                                                                
debug1: SSH2_MSG_KEXINIT received                                                                      
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1         
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],[email protected],[email protected],ssh-rsa,ssh-dss       
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]                                                
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]                                                
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96                                      
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96                                      
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
debug2: kex_parse_kexinit: ssh-rsa,rsa-sha2-512,rsa-sha2-256
debug2: kex_parse_kexinit: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: kex_parse_kexinit: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: found hmac-sha1
debug1: kex: server->client aes128-ctr hmac-sha1 none
debug2: mac_setup: found hmac-sha1
debug1: kex: client->server aes128-ctr hmac-sha1 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
Connection closed by <server-ip>

从服务器我得到以上内容,

root@srv1:/etc# tail -f /var/log/auth.log | grep ssh
Jul 16 17:45:42 srv1 sshd[500]: error: key_load_private: invalid format
Jul 16 17:45:42 srv1 sshd[500]: error: key_load_public: invalid format
Jul 16 17:45:42 srv1 sshd[500]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Jul 16 17:45:42 srv1 sshd[500]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Jul 16 17:45:42 srv1 sshd[500]: ssh_dispatch_run_fatal: Connection from <client-ip> port 56181: incomplete message [preauth]

Stretch(服务器)中 sshd 的版本,

OpenSSH_7.4p1 Debian-10, OpenSSL 1.0.2l  25 May 2017

相关内容