只需要在sshd配置文件中加入以下行即可:
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1
#KexAlgorithms diffie-hellman-group1-sha1,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1 此行支持舊的加密算法
重啟sshd
原因大概就是
use libssh2, and libssh2 only support diffie-hellman key exchange methods
而且升級libssh2也未能解決,應該是個bug。
【原因導致】
服務器的sshd服務升級了