|
原因:虚拟机连了不同的wifi,主机名相同但是ip地址不一样。
解决:删除/root/.ssh/known_hosts下目标主机的密钥信息(目前的)
详解如下:
[root@node1 sbin]# scp /opt/hadoop-2.9.2/input/test.txt root@node2:/opt test.txt 100% 12 12.1KB/s 00:00
没有报错,但是将主机名换成IP地址后就会发现问题
[root@node1 sbin]# scp /opt/hadoop-2.9.2/input/test.txt root@192.168.191.5:/opt @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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 SHA256:lv1QRFf/1zC1aWxISaOIj6RCU4gw8TF3wJtSgYEW7C0. 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:7 RSA host key for 192.168.191.5 has changed and you have requested strict checking. Host key verification failed. lost connection
于是vi /root/.ssh/known_hosts,除本机以外的密钥信息都删除。
就可以正常使用scp了。
|