SSH使用记录

REMOTE HOST IDENTIFICATION HAS CHANGED

ssh远程登录云主机报错如下,远程主机认证key变了。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[user@hostname ~]$ ssh root@pong
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
6e:45:f9:a8:af:38:3d:a1:a5:c7:76:1d:02:f8:77:00.
Please contact your system administrator.
Add correct host key in /home/hostname /.ssh/known_hosts to get rid of this message.
Offending RSA key in /var/lib/sss/pubconf/known_hosts:4
RSA host key for pong has changed and you have requested strict checking.
Host key verification failed.

解决:

1
ssh-keygen -R <host>

-R hostname 从known_hosts文件中删除属于主机名的所有键。

no matching host key type found. Their offer: ssh-dss

ssh 登录时报错如下:

1
2
3
ssh root@192.168.8.109

Unable to negotiate with 192.168.8.109 port 22: no matching host key type found. Their offer: ssh-rsa

解决:

1
ssh -oHostKeyAlgorithms=+ssh-rsa root@192.168.8.109

原因,OpenSSH 升级后,默认删除了 ssh-rsa 算法,在访问时临时指定,或者可以在 ~/.ssh/config 或者 /etc/ssh/ssh_config 文件中添加如下内容。

详细内容可以参考 http://www.openssh.com/legacy.html

1
2
3
Host bitbucket.org
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2022-2023 ligongzhao
  • 访问人数: | 浏览次数:

请我喝杯咖啡吧~

支付宝
微信