标题secureCRT登录Ubuntu20.04提示Key exchange failed
在使用Ubuntu2004时,使用旧版本的secureCRT通过ssh连接时会报错如下:
Key exchange failed.
No compatible key exchange method. The server supports these methods: curve25519-sha256,curve25519-sha256@libssh.org,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
针对这个问题,解决方法如下:
1,修改ssh_config
将这个文件的如下两行找到将其前面的#去除
vim /etc/ssh/ssh_config
- 修改sshd_config
在这个文件中加入如下内容
vim /etc/ssh/sshd_config
KexAlgorithms 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
3,重启sshd服务
systemctl restart sshd