【轉】ssh登陸錯誤ECDSA host key for 10.10.10.10 has changed

當咱們使用ssh root@ip登陸Linux服務器時,服務器報錯:緩存

 

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:Ms+BRn93GbOO1fwP6g1O+UwSRFv9KIUMGeoHDt70OfQ.
Please contact your system administrator.
Add correct host key in /Users/aliyunbaike/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/aliyunbaike/.ssh/known_hosts:6
ECDSA host key for 47.74.190.156 has changed and you have requested strict checking.
Host key verification failed.

如何解決?緣由分析:服務器

這是因爲,ssh鏈接服務器時,若是以前鏈接過,ssh會默認保存該ip的鏈接協議信息,當咱們再次訪問此ip服務器時,ssh會自動匹配以前ssh保存的信息,因爲咱們的服務器作了更改,例如重裝系統等操做,會致使本地保存的ssh信息失效,因而再次鏈接時就會出現上述錯誤。ssh

另外,遠程服務器的ssh服務被卸載重裝或ssh相關數據(協議信息)被刪除也會致使這個錯誤。this

 

解決方案:spa

刪除本地known_hosts裏面的緩存信息便可。命令:ssh-keygen -R "你的遠程服務器ip地址"  .net

注意:R是大寫!
---------------------
做者:yunweifun
原文:https://blog.csdn.net/yunweifun/article/details/78763026 code

相關文章
相關標籤/搜索