当前位置:首页 » 《关于电脑》 » 正文

SecureCRT使用SSH登录服务器报错:Key exchange failed

6 人参与  2024年10月03日 14:40  分类 : 《关于电脑》  评论

点击全文阅读


SecureCRT使用SSH登录Ubuntu服务器报错:Key exchange failed

原因:
ssh客户端与服务器的公钥协商失败,SecureCRT客户端所指定的秘钥交换算法(KexAlgorithms ),不在服务端支持范围内。可能是服务端的sshd版本比较高、默认配置不支持一些比较旧的秘钥交换算法。

SecureCRT 7.0 仅支持下面几种:



解决方案:
方案1)升级SecureCRT到更高的版本。

方案2)修改sshd服务端配置、指定秘钥交换算法列表。以 ubuntu 为例:

vi /etc/ssh/sshd_config

在配置文件末尾追加配置(如果已经存在、就修改 KexAlgorithms  配置)如下:

# for SecurCRT (version < 8) ssh client
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diff
ie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1

或者配置:
KexAlgorithms +diffie-hellman-group-exchange-sha256,diffie-hellman-group1-sha1

重启服务:service sshd restart

方案3)如果无法本地登录管理服务端、只能ssh访问服务端的话,那可以试试用其他ssh客户端软件(支持服务端秘钥交换算法)先登录、修改服务端sshd配置文件、重启服务,然后就可以通过SecureCRT客户端登录了。
例如,如果安装了git,可以用git自带的 ssh.exe 登录、修改服务端配置。
cmd 命令行执行 ssh.exe 登录:
cd c:\Program Files\Git\usr\bin\
ssh.exe root@192.168.1.100

修改sshd配置后,重启sshd服务,然后就可以用SecureCRT SSH登录了。

另外,注意:如果是银河麒麟V10,配置会有差异,如果只是修改 KexAlgorithms 还不够,还是会报错:

Key exchange failed.
No compatible key exchange method. The server supports these methods: curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
No compatible MAC. The server supports these MACs: hmac-sha2-512,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha2-256-etm@openssh.com

后面仔细查看sshd配置文件,配置有些差异,配置有区别:

如果是银河麒麟V10系统,配置如下,需要注释掉原来的 Ciphers、MACs、KexAlgorithms 参数,然后再重新配置 KexAlgorithms 追加到末尾:
Protocol 2
LogLevel VERBOSE
PubkeyAuthentication yes
RSAAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
PermitUserEnvironment no
#Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com
ClientAliveCountMax 0
Banner /etc/issue.net
#MACs hmac-sha2-512,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha2-256-etm@openssh.com
StrictModes yes
AllowTcpForwarding no
AllowAgentForwarding no
GatewayPorts no
PermitTunnel no
#KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256

# national algorithm standards supports
#HostKeyAlgorithms sm2

# for SecurCRT (version < 8) ssh client
KexAlgorithms 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,diffie-hellman-group14-sha1


点击全文阅读


本文链接:http://zhangshiyu.com/post/167398.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

最新文章

  • 苔藓爬满旧日诺言全书+后续+结局顾砚廷慕晚夏免费苔藓爬满旧日诺言全书+后续+结局顾砚廷慕晚夏全书全
  • [我掉蛇女马甲后,点天灯假死丈夫悔疯了]免费试读_婆婆丁若菱蛇女精彩节选推荐
  • 他日若是同淋雪结局+番外(夏尔若林闻舟)他日若是同淋雪结局+番外结局_夏尔若林闻舟列表_笔趣阁(他日若是同淋雪结局+番外)
  • 他心非石反转剧情试读片段_安茗宝宝心掏后续更新+番外
  • 许星森纪冰雪(日暮青山绿渐隐许星森纪冰雪结局+番外)_(许星森纪冰雪)列表_笔趣阁(日暮青山绿渐隐许星森纪冰雪结局+番外)
  • 全文潮痕蚀月光(池清禾***宸)列表_全文潮痕蚀月光
  • 「江月随人处处圆」小说无删减版在线免费阅读_[陆晨小姐孟苒]精彩章节免费试读
  • 阮雾梨闻砚辞阮见微结局+番外全书+后续+结局(闻砚辞阮雾梨)列表_阮雾梨闻砚辞阮见微结局+番外(闻砚辞阮雾梨)阮雾梨闻砚辞阮见微结局+番外全书+后续+结局在线
  • 潮痕蚀月光结局+番外池清禾***宸(潮痕蚀月光结局+番外)全书免费池清禾***宸_潮痕蚀月光结局+番外池清禾***宸列表_笔趣阁(池清禾***宸)
  • 苔藓爬满旧日诺言一口气读完全书+后续全书+后续+结局(慕晚夏顾砚廷)列表_苔藓爬满旧日诺言一口气读完全书+后续(慕晚夏顾砚廷)苔藓爬满旧日诺言一口气读完全书+后续全书+后续+结局在线
  • 「孕弟」反转剧情碎片化试读_[耀祖弟弟子宫]小说精彩节选试读
  • 旧梦随风去结局+番外(姜予宁沈昭寒)列表_旧梦随风去结局+番外(姜予宁沈昭寒)全书+后续+结局在线

    关于我们 | 我要投稿 | 免责申明

    Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1