scp不可用:WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED

本文解释了在使用SSH连接时遇到的“远程主机标识已更改”警告的原因,并提供了具体的解决步骤,包括如何修改known_hosts文件来消除此警告。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

After doing ssh are you seeing this error.No problem it can be solved.

root@tuxworld:/tmp# ssh 10.10.0.16
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
13:f2:a2:87:ff:79:e5:92:79:b4:10:51:53:c2:fb:60.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:11
  remove with: ssh-keygen -f "/root/.ssh/known_hosts" -R 10.10.0.16
RSA host key for 10.10.0.16 has changed and you have requested strict checking.
Host key verification failed.
root@tuxworld:/tmp#

Why it happens ?
Answer : Because it is mismatch of fingerprint information which is saved in .known_hosts file in your system with fingerprint value available in Server.

How to solve the issue

You have to delete the particular line from ~/.ssh/known_hosts file.
see the line no. 12 in above message “Offending ECDSA key in /root/.ssh/known_hosts:11“.
In line you are getting number 11 . Hence this is the line no. in known_hosts which you have to delete.

Here we will use vi editor to directly jump into that line number

vi +11 ~/.ssh/known_hosts

Cursor will automatically move to line number you only have to type dd in vi editor to delete the line and then type :wq for save and exit

dd
:wq

当然,这里可以把指定ip的message删除掉。再次执行scp,系统会生成最新可用的message。

具体相关信息,可参看:http://sharadchhetri.com/2013/06/03/warning-remote-host-identification-has-changed/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值