SSHを使用したwheezyからstrechへの接続 - サーバーIPによって接続が閉じられました。

SSHを使用したwheezyからstrechへの接続 - サーバーIPによって接続が閉じられました。

Wheezyを実行する2台のコンピュータ、Jessieを実行する3台のコンピュータ、Stretchを実行する2台のコンピュータがあります。 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

関連情報