解決Host key verification failed.(親測有效)

一、發現問題

問題如下圖代碼:

$ 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 ECDSA key sent by the remote host is
SHA256:HDjXJvu0VYXWF+SKMZjSGn4FQmg/+w6eV9ljJvIXpx0.
Please contact your system administrator.
Add correct host key in /Users/wangdong/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/wangdong/.ssh/known_hosts:46
ECDSA host key for 108.61.163.242 has changed and you have requested strict checking.
Host key verification failed.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

這裏面,有一句很關鍵。

ECDSA host key for 108.61.163.242 has changed and you have requested strict checking.
Host key verification failed.

    1
    2

一般這個問題,是你重置過你的服務器後。你再次想訪問會出現這個問題。
二、解決問題

解決問題也很簡單:

ssh-keygen -R 你要訪問的IP地址

ssh [email protected]

輸入密碼,然後,用戶和密碼自動保存在/root/.ssh/knowhost

就可以了

   

發佈了8 篇原創文章 · 獲贊 20 · 訪問量 8萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章