scp传输报错解决

来源:互联网 发布:sql 批量replace 编辑:程序博客网 时间:2024/05/18 22:43

1.在ip为172.16.26.1的主机使用scp传输数据时发生下面的报错 (警告:远程主机标识已经更改!

[root@localhost /]# scp linux.txt 172.16.26.2:/

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
5b:4e:bf:fa:a0:98:c2:a6:96:ab:1e:d2:3d:3e:59:b6.
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 172.16.26.2 has changed and you have requested strict checking.
Host key verification failed.

lost connection

2.ssh了一下试试 发现了同样的报错

[root@localhost /]# ssh 172.16.26.2
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
5b:4e:bf:fa:a0:98:c2:a6:96:ab:1e:d2:3d:3e:59:b6.
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 172.16.26.2 has changed and you have requested strict checking.
Host key verification failed.

3.用172.16.26.2这台主机 scp时是正常的没有出现错误,一定是172.16.26.1上出现了问题

4.查看了一下家目录下的.ssh/known_hosts
删除.ssh/known_hosts 中关于远程主机的那部分
重新ssh 远程主机ip   
连接成功

可能的原因是在以前曾有172.16.26.2的其他主机ssh过,所以导致远程主机标识不同了,才报的错

不知理解的是否正确,请多多指教

原创粉丝点击