1. 程式人生 > >ssh 登入不瞭解決方案

ssh 登入不瞭解決方案

使用SSH登入某臺機器,有時因為機器重新安裝系統,會出現以下資訊:

bash-3.2# ssh [email protected]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
98:d7:04:b6:35:0e:22:ea:35:a4:1f:70:0f:7c:b9:55.
Please contact your system administrator.
Add correct host key in /var/root/.ssh/known_hosts to get rid of this message.
Offending RSA key in /var/root/.ssh/known_hosts:3
RSA host key for x.x.x.x has changed and you have requested strict checking.
Host key verification failed.

solution: 
刪除提示資訊中,對應的行數,例如上例,需要刪除/home/cobyeah/.ssh/known_hosts檔案中對應出現的ip(x.x.x.x)那條資料,然後就能登入了。