合 ssh连接远程欧拉系统时报错Unable to negotiate with 100.194.18.75 port 22: no matching host key type found. Their offer: ssh-rsa
Tags: 故障处理LinuxsshopenEuler欧拉sshdsshd_config
现象
在openeuler 22.03中,通过ssh连接远程欧拉服务器报错:
1 2 3 4 5 6 7 8 | [root@mdw ~]# ssh gpadmin@sdw1 Unable to negotiate with 100.194.18.75 port 22: no matching host key type found. Their offer: ssh-rsa [root@lhropeneuler22 /]# rpm -qa | grep openssh openssh-clients-8.8p1-22.oe2203.x86_64 openssh-server-8.8p1-22.oe2203.x86_64 openssh-8.8p1-22.oe2203.x86_64 |
分析
报错信息大概说的是没有匹配到类型为ssh-rsa的主机秘钥。
openssh觉得ssh-rsa加密方式不安全, 直接从8.8开始默认不允许这种密钥用于登陆了。
解决
方法1 永久
1 2 3 | echo 'HostKey /etc/ssh/ssh_host_ecdsa_key' >> /etc/ssh/sshd_config systemctl restart sshd |
方法2 临时
1 | ssh -o HostKeyAlgorithms=+ssh-rsa user@host |