对一台机器重装并配置原来的IP之后无法使用scp或ssh [转载]

时间:2022-06-29 14:24:30

 

[root@rac1 ~]# scp installpackage.sh 192.168.8.237:/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 08:bc:6b:6a:cb:1f:05:51:a5:33:ac:8b:28:50:a2:4d. 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:6 RSA host key for 192.168.8.237 has changed and you have requested strict checking. Host key verification failed. lost connection

因为同一个IP远端的信息有变动,与存在本地的公钥不相符.

解决办法:删除本地的记录信息1、[root@rac1 ~]# cd .ssh/            2、[root@rac1 .ssh]# ls known_hosts     3、 [root@rac1 .ssh]# vi known_hosts

192.168.2.71 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArL+Gg9PZi536IRjYRur18qKrB+qeiPpSETFi7EnzFBqhqlGW8nIB3etufKFiX/E68dM6XcU4USQllwKebz373hjxXj3F5Ahr8/+ualDDkjh8ujSJnysioPtbrZS57RDtmMR8BXusETFCwjZjxSUQ9q+rKwSh4WpAQc6O5yoaGZlhntv7/Ij+s8PlGBb5ZbR2tUASxz/cbUAhhdvhnYlIijx9XV4jZJApS7g7s38h8T0gysYSH44lEYRmRXz+L3bQciHYx+i2s1kF4H0XnRkUpK9kRpZ0NddWXnAPLN192j/SKh1pic7/6aUH1HrGNv2jgC9wzZvs3I+zyQ== 192.168.7.25 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArFgDJR1xVUBGOP2EDYe/ZFdVpNLxu9V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