当前位置:   article > 正文

xshell登录报错:no matching host key type found. Their offer: ssh-rsa,ssh-dss [preauth]

no matching host key type found. their offer: ssh-rsa,ssh-dss

一、问题简述

某次xshell远程登录某台云主机,报错如下:找不到匹配的hot key算法
在这里插入图片描述

现场版本:Openssh 9.3,xshell:Xshell.exe: 5.0.0032, nssock2.dll: 5.0.0020, nsssh3.dll: 5.0.0026,

二、测试验证

1)连不上后的报错:
在这里插入图片描述
2)用其他linux主机验证登录目标主机,看是否正常

使用OpenSSH_7.4p1作为客户端测试正常;
在这里插入图片描述
如果不行,用以下命令测试:

ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa  user@host -p 122
  • 1

SSH协议中,“SSH-rsa”签名方案使用SHA-1哈希算法和rsa公钥算法。OpenSSH将在不久的将来默认禁用此签名方案。请注意,停用“ssh-rsa”签名并不一定需要停止使用rsa密钥。在SSH协议中,密钥可能能够使用多种算法进行签名。特别是,“ssh-rsa”密钥能够使用“rsa-sha2-256”(rsa/SHA256)、“rsa-sa2-512”(rsa/CHA512)和“ssh-rsa”(rsa/SHA1)进行签名。默认情况下,只有最后一个处于关闭状态。>=8.2p1 版的 openssh 的 ssh 客户端默认禁用了 ssh-rsa 算法。 对于7.0,基于安全考虑,OpenSSH7.0将diffie-hellman-group1-sha1,ssh-dss等运行时状态默认变更为禁用。更多参看openssh

3)可查询你本地电脑的主机秘钥保存目录,清理旧的后重新连接尝试

现场版本的目录是在%Documents%\NetSarang\SECSH\UserKeys 这个目录下:C:\Users\Administrator\Documents\NetSarang\SECSH

4)linux本地创建客户端配置文件指定连接会话协商算法

vi ~/.ssh/config  #配置
Host old-host或*
    HostkeyAlgorithms +ssh-rsa
	PubkeyAcceptedAlgorithms +ssh-rsa
  • 1
  • 2
  • 3
  • 4

三、处理

更换高版本xshell:5.0.0052(Build 1255)

在这里插入图片描述调试登录显示如下:

Connection established.
To escape to local shell, press ‘Ctrl+Alt+]’.
[14:44:19] Version exchange initiated…
[14:44:19] server: SSH-2.0-OpenSSH_9.3
[14:44:19] client: SSH-2.0-nsssh2_5.0.0045 NetSarang Computer, Inc.
[14:44:19] SSH2 is selected.
[14:44:19] Algorithm negotiation initiated… (Dialog mode)
[14:44:19] key exchange: diffie-hellman-group-exchange-sha256
[14:44:19] host key: ecdsa-sha2-nistp256
[14:44:19] outgoing encryption: aes256-ctr
[14:44:19] incoming encryption: aes256-ctr
[14:44:19] outgoing mac: hmac-sha1
[14:44:19] incoming mac: hmac-sha1
[14:44:19] outgoing compression: none
[14:44:19] incoming compression: none
[14:44:20] Host authentication initiated…
[14:44:20] Hostkey fingerprint:
[14:44:20] ssh-ecdsa ……
[14:44:20] Accepted. Verifying host key…
[14:44:20] Verified.
[14:44:20] User authentication initiated… (Dialog mode)
[14:44:20] Sent user name ‘root’.
You have logged onto a secured server…All accesses logged
[14:44:20] Sent password.
[14:44:20] Access granted.

综上,遇到这种问题,Windows的话还是升级xshell吧!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/789861
推荐阅读
相关标签
  

闽ICP备14008679号