Mac下Host key verification failed 解決辦法

在重裝系統(tǒng)后出現(xiàn)了這個問題

MacBook-Pro:~ harrytc$ ssh root@ hostname  
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:4Tz7f7UkuVF8LaJNRERmAtS0uUNjQj/l1ITvKyxhU7w.
Please contact your system administrator.
Add correct host key in /Users/harrytc/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/harrytc/.ssh/known_hosts:2
ECDSA host key for hostname has changed and you have requested strict checking.
Host key verification failed.

"Host key verification failed" 是指 remote host 的 host key 被改變了。
host keys 存在 ~/.ssh/known_hosts.
你可以edit這個file,把舊的host key刪掉 或者用這個command來

update:ssh-keygen -R hostname

The authenticity of host 'hostname (hostname)' can't be established.
ECDSA key fingerprint is
SHA256:4Tz7f7UkuVF8LaJNRERmAtS0uUNjQj/l1ITvKyxhU7w.
Are you sure you want to continue connecting (yes/no)? yes

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容