ssh连接交换机报错Unable to negotiate with xx port 22: no matching host key type found. Their offer: ssh-rsa
背景:部门部署了oxidized,现有一堆交换机需要备份网络配置,添加了oxidized后打开web发现全都获取不到,尝试在oxidized服务器上本机上ssh连接交换机报错:no matching host key type found. Their offer: ssh-rsa
解决方法:
在/root/.ssh/下新建config文件。添加如下内容
[root@oxidized .ssh]# cat /root/.ssh/config
Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
修改文件权限:
[root@oxidized .ssh]# chmod 600 config
再次尝试ssh,问题解决:
[root@oxidized .ssh]# ssh 10.13.102.13
The authenticity of host '10.13.102.13 (10.13.102.13)' can't be established.
RSA key fingerprint is SHA256:DpXpHClxon4L5djfS4HtQ7w92bzOE4S9lhYpscHuG6s.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.13.102.13' (RSA) to the list of known hosts.
root@10.13.102.13's password: