自用的一臺服務器上次yum update到centos 7.4,剛纔發現跳轉不過去了,提示:
expected key exchange group packet from server
趕緊登陸服務器看一下,誒,可以ssh登陸啊。SSH通道換成密碼的形式,也是不行。
看一下SSHD的日誌
journalctl --unit sshd --no-pager
Jan 24 17:51:20 hk sshd[1989]: /etc/ssh/sshd_config line 50: Deprecated option RSAAuthentication
Jan 24 17:51:20 hk systemd[1]: Started OpenSSH server daemon.
Jan 24 17:51:22 hk sshd[1990]: rexec line 50: Deprecated option RSAAuthentication
Jan 24 17:51:22 hk sshd[1990]: error: kex protocol error: type 30 seq 1 [preauth]
嘿,升級了openssh版本了啊,這個配置參數已經是被廢棄掉的
於是我備份一下/etc/ssh/sshd_config文件便刪掉了50行的RSAAuthentication
重啓再試,嘿,還是不行,現在就剩下這句提示了:
error: kex protocol error: type 30 seq 1 [preauth]
度娘一下,悻悻的打開了小飛機,發現這篇文章有着跟我一樣的情況
https://github.com/Studio3T/robomongo/issues/1125
得,試試唄。
# Add this to /etc/ssh/sshd_config
KexAlgorithms [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
提示什麼缺少什麼自行添加
KexAlgorithms diffie-hellman-group1-sha1,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
Ciphers 3des-cbc,blowfish-cbc,aes128-cbc,aes128-ctr,aes256-ctr
# systemctl restart sshd
原因大概就是
use libssh2, and libssh2 only support diffie-hellman key exchange methods
而且升級libssh2也不能解決,應該是個bug。
ps:只有在centos 7.4版本出現,7.3和7.5均沒有這種情況
p.s. 建議更新navicat客戶端版本解決