解决SCP传输错误“WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! ”

今天使用SCP命令在服务器上传输文件,由于更换了服务器的操作系统,导致再次使用SCP命令传输文件时,出现了“WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! ”错误,错误的详细显示信息如下:

[root@localhost ~]# scp -r images root@45.78.187.138:/var/www/lixinxing.xyz/content/
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 @ 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 the RSA host key has just been changed.
 The fingerprint for the RSA key sent by the remote host is
 32:6d:c5:e1:77:62:2b:5c:4b:58:39:08:d7:1a:fb:cd.
 Please contact your system administrator.
 Add correct host key in /root/.ssh/known_hosts to get rid of this message.
 Offending key in /root/.ssh/known_hosts:1
 RSA host key for 45.78.187.138 has changed and you have requested strict checking.
 Host key verification failed.
 lost connection

解决这个错误需要编辑./ssh/known_hosts文件,删除已经认证的服务器信息。

cd .ssh
nano known_hosts

删除这段信息即可:

 45.78.187.138 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDLrcCQSaux5C/5vftMSjPnoaP6iMIqmS9V+XyaKPTXLPRGHwNPnHGYuBrSJIx8ief69T$

这样,问题解决了!

原创文章,转载请注明: 转载自科技爱好者博客

本文链接地址: 解决SCP传输错误“WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! ” (https://www.tujing.site/2541)

如果博客对您有帮助,请给我 赞助


热度:4,254℃

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注