【问题】
[[email protected]_EXERCISE mnt]# scp [email protected]:/etc/profile.d/motd1.sh /etc/profile.d/
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
c4:8b:39:c7:25:ff:dd:e3:8f:56:d4:d6:1b:8b:98:5b.
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:4
RSA host key for 172.16.40.240 has changed and you have requested strict checking.
Host key verification failed.
[[email protected]_EXERCISE mnt]# ssh 172.16.40.240
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
c4:8b:39:c7:25:ff:dd:e3:8f:56:d4:d6:1b:8b:98:5b.
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:4
RSA host key for 172.16.40.240 has changed and you have requested strict checking.
Host key verification failed.
【分析】
known_hosts是记录远程主机的公钥的文件,之前重装个系统,而保存的公钥还是未重装系统的系统公钥,在ssh链接的时候首先会验证公钥,如果公钥不对,那么就会报错。
【解决办法】
方法一:[[email protected]_EXERCISE mnt]# vim ~/.ssh/known_hosts
删除172.16.40.240的相关rsa的信息即可.
方法二:ssh-keygen -R 172.16.40.240