REMOTE HOST IDENTIFICATION HAS CHANGED 問題解決

weixin_34249678發表於2016-10-09

今天處理 ssh連線至 ubuntu 伺服器時,提示以下錯誤:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@    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

da:f7:3e:ba:f7:00:e6:44:76:f2:58:6e:48:**.

Please contact your system administrator.

Add correct host key in /使用者home目錄/.ssh/known_hosts to get rid of this message.

Offending RSA key in /使用者home目錄/.ssh/known_hosts:1

RSA host key for ip地址 has changed and you have requested strict checking.

Host key verification failed.

經過google,出現這個問題的原因是,第一次使用SSH連線時,會生成一個認證,儲存在客戶端的known_hosts中.

可使用以下指令檢視:

ssh-keygen -l -f ~/.ssh/known_hosts

由於伺服器重新安裝系統了,所以會出現以上錯誤。

解決辦法

ssh-keygen -R 伺服器端的ip地址

會出現以下提示:

Host 192.168.3.10 found: line 1 type RSA

/使用者home目錄/.ssh/known_hosts updated.

Original contents retained as /使用者home目錄/.ssh/known_hosts.old

重新連線,出現以下提示:

The authenticity of host '192.168.3.10 (192.168.3.10)' can't be established.

RSA key fingerprint is da:f7:3e:ba:f7:00:e6:44:76:f2:58:6e:48:**.

Are you sure you want to continue connecting (yes/no)?

輸入yes確認即可連線成功.


相關文章