SSH远程链接服务器出错

场景缓存

某日线上排查问题,在堡垒机上面经过SSH链接其它服务器时报错(报错信息以下),遂始查,遍寻baidu、google,都是说要重置用户目录下的ssh文件夹,我以为这样作很不妥,举个例子,你不能由于系统的记事本不能用了,就重装系统吧?服务器

报错信息app

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
SHA256:*******
Please contact your system administrator.
Add correct host key in /Users/apple/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/apple/.ssh/known_hosts:17
RSA host key for [***ip address***] has changed and you have requested strict checking.
Host key verification failed.

出现缘由ssh

看错误描述,应该是SSH用到的RSA秘钥出了问题,突然想起,前几日要链接的这个服务器作了SSH模块升级,相比也是重置了秘钥,因此堡垒机下缓存的公钥应该是无效的,因此没法链接到对应服务器this

解决方法google

编辑堡垒机用户目录下的ssh文件夹中的know_hosts文件,删除对应IP的公钥记录便可~code

相关文章
相关标签/搜索