现象
xshell5登录欧拉22.03时报错:找不到匹配的host key 算法
解决方法一:
1.编辑/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
2.重启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
2.重启sshd服务
systemctl restart sshd
文章提供了两种解决Xshell5在尝试登录欧拉22.03时遇到的找不到匹配的hostkey算法错误的方法。方法一是修改sshd_config文件,增加支持RSA的算法;方法二是屏蔽掉不支持的算法行,然后重启sshd服务。



4276

被折叠的 条评论
为什么被折叠?



