新开的腾讯云 CVM 密钥无法使用 Secure CRT 连接 显示密钥交换失败 报错

新开的腾讯云 CVM 密钥无法使用 Secure CRT 连接 显示密钥交换失败 报错


解决办法:


sudo vi /etc/ssh/sshd_config


找到

KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256


在后面添加 sha1 的支持即可 ,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1


最后拼接后的:


KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1


最后重启一下 sshd 

sudo systemctl restart sshd


大功告成~