系统:rhel 6.5

问题描述:使用scp传送文件时,出现告警“WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!”,如下所示:

[root@localhost rmanbak]# scp ctl_i1158ubk_1_1.bak root@192.168.190.218:/tmp
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
ea:ab:7c:4e:d0:61:6b:f6:cb:80:b7:32:79:d1:e6:e8.
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:2
RSA host key for 192.168.190.218 has changed and you have requested strict checking.
Host key verification failed.
lost connection

异常原因:

因为主机名为localhost的已经给IP为192.168.190.218生成过公匙. 然而IP为192.168.190.218的主机系统因某种原因被重建过,重建时使用了相同IP地址,那么当scp或者ssh相同IP的新主机时就会出现以上告警。

解决方案:

清除旧公匙信息.

[root@localhost rmanbak]# ssh-keygen-R 192.168.190.218

清除后,scp正常传送文件.