SecureCRT--解决Key exchange failed.No compatible key-exchange method

 

简介

        本文介绍SecureCrt连接Linux的报错问题:Key exchange failed.No compatible key-exchange method

问题复现

我在使用SecureCrt连接Linux时,报了如下错误:

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为最新版,或者使用其他连接工具

第二种: 修改服务器,使其兼容老系统的算法
登录服务器后,在服务器里使用下面命令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

树莓加入相

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

我是将原来的sshd_config先备份了下叫sshd_oldconfig,以防报错回去

然后将添加的文档加在这里成功了,注意,之前加在绿色框下面的时候,重启ssh的时候报错。

然后重启命令用这个:sudo /etc/init.d/ssh restart

再次用SecureCRT连接,正常了。

  • 5
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值