WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

有時後連線ssh會出現如下的錯誤訊息,通常我都會到登入帳號的家目錄下對隱藏目錄.ssh中know_hosts的內容做修改,刪除它所提到的的那一行。

但其實最簡單的作法是執行指令: ssh-keygen -R 192.168.122.238
上面指令就是要移除屬於該host的所有key。
接著只要在重新連線一遍就行了。

jerry@jerry-P5Q:~$ ssh root@192.168.122.238
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
e2:cb:68:4f:73:97:b6:21:0e:5a:9e:ae:0a:9f:da:dd.
Please contact your system administrator.
Add correct host key in /home/jerry/.ssh/known_hosts to get rid of this message.
Offending key in /home/jerry/.ssh/known_hosts:36
RSA host key for 192.168.122.238 has changed and you have requested strict checking.
Host key verification failed.
jerry@jerry-P5Q:~$ ssh-keygen -R 192.168.122.238
/home/jerry/.ssh/known_hosts updated.
Original contents retained as /home/jerry/.ssh/known_hosts.old
jerry@jerry-P5Q:~$ ssh root@192.168.122.238
The authenticity of host '192.168.122.238 (192.168.122.238)' can't be established.
RSA key fingerprint is e2:cb:68:4f:73:97:b6:21:0e:5a:9e:ae:0a:9f:da:dd.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.122.238' (RSA) to the list of known hosts.
root@192.168.122.238's password: 
Last login: Thu Nov 24 11:47:44 2011
[root@pcmk-1 ~]#

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s