In peacetime work, sometimes need SSH login to other Linux host up, but sometimes SSH login will be banned, and pop up the following similar hint:
Warning:remote HOST identification has changed!it are POSSIBLE that SOMEONE are DOING SOMETHING nasty! Someone could is eavesdropping on your right now (Man-in-the-middle attack)! It is also possible, the RSA host key has just been changed. The fingerprint for the RSA key sent by the remote host IS36:68:A6:E6:43:34:6B:82:D7:F4:DF:1F:C2:E7:37:CC. Please contact your system administrator. Add correct host key in/u/xlian008/.ssh/known_hosts to get rid of the this message. Offending key In/u/xlian008/.ssh/known_hosts:2rsa host key for 135.1.35.130 had changed and you have requested strict Che Cking. Host Key verification failed.
It was rather strange, so I studied it a bit.
SSH will record every public key you have accessed your computer in ~/.ssh/known_hosts. The next time you access the same computer, OpenSSH checks the public key. If the public key is different, OpenSSH warns you against attacks such as DNS hijack. This is the situation I have listed above.
Cause: There are more than one Linux system on a host, will switch frequently, then these systems use the same IP, log in once after the SSH information is recorded in the local ~/.ssh/known_hsots file, switch the system and then SSH access to this host will be a conflict warning, You need to manually delete the contents of the modified known_hsots.
The following two solutions are available:
1. Manually delete the contents of the modified known_hsots;
2. Modify the configuration file "~/.ssh/config", plus these two lines, restart the server.
Stricthostkeychecking No
Userknownhostsfile/dev/null
Advantages and Disadvantages
1. You need to manually delete the contents of the file, some automation scripts can not be run (when SSH login failed), but high security;
2. SSH login will ignore known_hsots access, but the security is low.
Linux known_host files for SSH