0
点赞
收藏
分享

微信扫一扫

xshell5登录报"找不到匹配的host key算法"的错误

现象

xshell5登录欧拉22.03时报错:找不到匹配的host key算法

解决方法

编辑/etc/ssh/sshd_config,如下所示:

# 在行尾增加",ecdh-sha2-nistp521",以满足ecdsa公钥方式登录(密钥长度521)
KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp521

# 在行尾增加",ssh-rsa",以满足RSA登录
HostKeyAlgorithms ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-256,rsa-sha2-512,ssh-rsa

# 在行尾增加",ssh-rsa",以满足RSA登录
PubkeyAcceptedKeyTypes ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-256,rsa-sha2-512,ssh-rsa

xshell5登录报"找不到匹配的host key算法"的错误_xshell5找不到匹配的hostkry

重启sshd服务,在次登录即可

systemctl restart sshd


另外一个解决方法屏蔽的方式测试过没用,只能用上面方法才能解决

1.编辑/etc/ssh/sshd_config,如下所示:

# 屏蔽下面的2行(最后2行)
# HostKeyAlgorithms ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-256,rsa-sha2-512
# PubkeyAcceptedKeyTypes ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-256,rsa-sha2-512


举报

相关推荐

0 条评论