解决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! ” (http://blog.lxx1.com/2541)

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


科技爱好者

工科学生大四在读,专业嵌入式开发,喜欢计算机,喜欢单片机,喜欢各种各样美好的东西,相信科技正在改变世界! 这是我的 个人博客

发表评论

电子邮件地址不会被公开。 必填项已用*标注

This site uses Akismet to reduce spam. Learn how your comment data is processed.