问题描述

安装了ubuntu20.04后,以前老版本的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

解决方法

需要修改两个地方:

修改ssh_config

sudo vi /etc/ssh/ssh_config

打开这两行的注释

在这里插入图片描述

修改sshd_config

sudo vi /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

重新启动服务并测试

重启sshd服务

sudo service sshd restart

重新连接:
在这里插入图片描述

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐