Client端以SSH連線到主機時,會要求產生認證資訊,儲存在client端的~/.ssh/known_ssh檔中。
如果有連線到多台不同主機,known_hosts裡面就會記錄許多記錄。
但是,假如server被重灌了,這樣子新的server就和known_hosts裡的狀態不同,
再連線時,就會出現底下錯誤:
[root@desktop10 ~]# ssh -X 192.168.0.110
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
0a:3e:d1:fb:de:3a:4f:eb:20:b7:44:50:76:61:36:46.
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 192.168.0.110 has changed and you have requested strict checking.
Host key verification failed.
這時,最簡單的方式,就是將known_hosts這個檔刪除,往後再連線主機時,就再重新產生認證資訊就好了。
進入
vi /root/.ssh/known_host (將192.168.0.110這個連線的KEY給刪除就可以了)
或者
rm -rf /root/.ssh/known_host (直接將整個檔案給刪掉是最快的!!!)
留言列表