Ubuntu 16.10中SSH客戶端(v.1.7)中的一個有趣的錯誤。當我嘗試:SSH中的「由遠程主機關閉連接」,而在Putty中一切順利
我得到:
Connection to 106.109.128.209 closed by remote host.
Connection to 106.109.128.209 closed.
當我做同樣的膩子,所有連接以及。
什麼問題?我檢查了hosts.allow/hosts.deny和sshd_config中的明顯內容。我很確定問題出在客戶身上。 Ubuntu 16.10中的SSH客戶端是否有問題?
如果它是有用的,這裏是詳細outbut:
ssh -vvvv [email protected]
OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "106.109.128.209" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 106.109.128.209 [106.109.128.209] port 22.
debug1: Connection established.
debug1: identity file /home/volkova_ta/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/volkova_ta/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/volkova_ta/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/volkova_ta/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/volkova_ta/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/volkova_ta/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/volkova_ta/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/volkova_ta/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6
debug1: match: OpenSSH_6.6 pat OpenSSH_6.5*,OpenSSH_6.6* compat 0x14000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 106.109.128.209:22 as 'root'
debug2: compat_kex_proposal: original KEX proposal: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,ext-info-c
debug2: Compat: skipping algorithm "[email protected]"
debug2: compat_kex_proposal: compat KEX proposal: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,ext-info-c
debug3: hostkeys_foreach: reading file "/home/volkova_ta/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/volkova_ta/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys from 106.109.128.209
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected],zlib
debug2: compression stoc: none,[email protected],zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: [email protected],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: host key algorithms: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],hmac-s[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: compression ctos: none,[email protected]
debug2: compression stoc: none,[email protected]
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: ecdh-sha2-nistp256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:3gA2nZPHOKD98O1OE6D2+nZMJeyzv6iENPc3vVlEb0s
debug3: hostkeys_foreach: reading file "/home/volkova_ta/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/volkova_ta/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys from 106.109.128.209
debug1: Host '106.109.128.209' is known and matches the ECDSA host key.
debug1: Found key in /home/volkova_ta/.ssh/known_hosts:1
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug2: compat_kex_proposal: original KEX proposal: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
debug2: Compat: skipping algorithm "[email protected]"
debug2: compat_kex_proposal: compat KEX proposal: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
debug2: key: /home/volkova_ta/.ssh/id_rsa (0x55f42a6266d0), agent
debug2: key: /home/volkova_ta/.ssh/id_dsa ((nil))
debug2: key: /home/volkova_ta/.ssh/id_ecdsa ((nil))
debug2: key: /home/volkova_ta/.ssh/id_ed25519 ((nil))
debug3: send packet: type 5
debug1: Authentication succeeded (none).
Authenticated to 106.109.128.209 ([106.109.128.209]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting [email protected]
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: network
debug3: send packet: type 1
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
#0 client-session (t3 r-1 i0/0 o0/0 fd 5/6 cc -1)
Connection to 106.109.128.209 closed by remote host.
Connection to 106.109.128.209 closed.
Transferred: sent 1560, received 1944 bytes, in 0.0 seconds
Bytes per second: sent 17355740.7, received 21627923.0
debug1: Exit status -1
的ls -l /home/volkova_ta/.ssh/
顯示輸出:
итого 36
-rw------- 1 volkova_ta volkova_ta 1679 июн 14 18:55 id_rsa
-rw-r--r-- 1 volkova_ta volkova_ta 407 июн 14 18:55 id_rsa.pub
-rw-r--r-- 1 volkova_ta volkova_ta 222 июн 14 19:07 known_hosts
在主機端: 的/etc/hosts.allow
內容和/etc/hosts.deny
是空的。 MaxStartups爲10:30:100從journalctl _COMM=sshd
(在/etc/ssh/sshd_config
)
登錄:
Jun 15 15:49:54 artik sshd[2623]: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Jun 15 15:49:54 artik sshd[2623]: Connection from 106.109.129.237 port 42774 on 106.109.128.209 port 22
Jun 15 15:49:54 artik sshd[2623]: Decryption integrity check failed [preauth]
謝謝!
UPD:我想這是因爲兩臺機器的open-ssh版本不匹配。所以他們使用不同的密碼。 ssh -oCiphers=aes128-ctr [email protected]
解決了這個問題。
要設置的密碼永遠: sudo bash -c 'echo "Ciphers aes128-ctr" >> /etc/ssh/ssh_config'
顯示了'ls -l/home/volkova_ta/.ssh /'的內容。 – zombic
@zombic準備就緒,在帖子中查看 –
在服務器上運行'grep sshd/etc/hosts.allow','cat/etc/hosts.deny'和'grep MaxStartups/etc/ssh/sshd_config'。 – zombic