SecureCRT连接服务器时报错,报错信息为:
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
一、原因分析
错误原因是SecureCRT 7.0客户端支持的和esxi作为ssh服务端支持的SSH秘钥交换算法不匹配。
Secure CRT 7.0的默认支持key exchange算法
二、解决方法
第一种: 升级SecureCRT为最新版,或者使用其他连接工具(有效)
第二种: 修改服务器,使其兼容老系统的算法(有效)
第三种:删除配置文件(无效)
第四种:下载新版本后添加密钥支持(有效)
三、修改文件方法
需要修改两个地方:
1、修改ssh_config
sudo vi /etc/ssh/ssh_config
1.1 打开这两行的注释

2、修改sshd_config
sudo vi /etc/ssh/sshd_config
2.1加入下面的代码
#加入下面的文本
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服务
linux:
sudo service sshd restart
esxi:
[root@esxi:/etc/init.d] ./SSH restart
SSH login disabled
SSH login enabled
四、删除配置文件
1、查看配置文件路径

全局选项

或者是这个页面

删除ssh2.ini

五、更新版本,添加密钥
CRT的会话设置内有关于密匙交互的选项,如下图,将密匙交换内的选项全部勾选后,ssh登录即可恢复

推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://hqyman.cn/post/5085.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
打赏

微信支付宝扫一扫,打赏作者吧~
休息一下~~