Xshell5登录openEuler操作系统报“找不到匹配的host key算法”错误

1.XSHELL5连接openEuler报错如下图:

 

2.操作系统版本:

[root@localhost ~]# cat /etc/openEuler-release 
openEuler release 22.03 (LTS-SP2)

3.编辑/etc/ssh/sshd_config做如下修改:

#注释
#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
# 在行尾增加",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

4.重启sshd服务:

[root@localhost ~]# systemctl restart sshd

 

posted @ 2023-11-06 15:54  春风雨露  阅读(1636)  评论(0编辑  收藏  举报