ssh远程redhat6报错:Unable to negotiate with *.*.*.* port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss

发布时间 2023-06-02 11:25:36作者: 咿呀哒喏

报错:Unable to negotiate with *.*.*.* port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss

分析:openssh觉得ssh-rsa加密方式不安全, 直接从8.8开始默认不允许这种密钥用于登陆了

 

解决:

cat /etc/ssh/ssh_config.d/redhat6.conf
Host *
PubkeyAcceptedKeyTypes +ssh-rsa
HostKeyAlgorithms +ssh-rsa

第一行说明对所有主机生效,

第二行是将ssh-rsa加会允许使用的范围,

第三行是指定所有主机使用的都是ssh-rsa算法的key