REMOTE HOST IDENTIFICATION HAS CHANGED 问题解决

[外链图片转存失败(img-ekE3oGf7-1564713340926)(evernotecid://D7D93712-3C2E-4EC3-AA0B-D1A7842C2B81/appyinxiangcom/21861001/ENResource/p263)]

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:KiHNyOpWDO1oaK2wmc4sEw596cd7VEy7ayEMx6od9RA.
Please contact your system administrator.
Add correct host key in /Users/huwq_galaxy/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/huwq_galaxy/.ssh/known_hosts:6
RSA host key for 172.16.112.51 has changed and you have requested strict checking.
Host key verification failed.

经过google,出现这个问题的原因是,第一次使用SSH连接时,会生成一个认证,储存在客户端的known_hosts中。
可使用以下指令查看:

ssh-keygen -l -f ~/.ssh/known_hosts

由于服务器重新安装系统了,所以会出现以上错误。
解决办法

ssh-keygen -R 服务器端的ip地址

会出现以下提示:

# Host 172.16.112.51 found: line 6
/Users/huwq_galaxy/.ssh/known_hosts updated.
Original contents retained as /Users/huwq_galaxy/.ssh/known_hosts.old

重新连线,出现以下提示:

huweiqindeMacBook-Pro:~ huwq_galaxy$ ssh root@ip地址
The authenticity of host 'ip地址 (ip地址)' can't be established.
RSA key fingerprint is SHA256:balabala.
Are you sure you want to continue connecting (yes/no)? yes

输入yes确认即可连线成功。

当出现"WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!"这个错误时,说明远程主机的身份识别信息发生了变化,可能是由于设备系统重装或IP冲突等原因造成的[1]。为了解决这个问题,可以采取以下步骤: 1. 首先,你可以使用以下命令来删除已知主机的公钥信息:ssh-keygen -R <host>。其中,<host>是你要连接的主机的地址。这样可以清除之前与该主机相关的身份识别信息,以便重新建立连接。 2. 接下来,当再次连接该主机时,系统会询问是否信任新的主机身份。你可以输入"yes"并按回车键来确认连接。这样可以解决身份验证错误并成功连接到主机。 通过以上步骤,你应该能够解决"WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!"的问题并成功连接到远程主机。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [【linux】WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED 解决方法](https://blog.csdn.net/qq_41884002/article/details/123358315)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [ssh 登录 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! 解决办法](https://blog.csdn.net/weixin_32393347/article/details/127207684)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值