阿里雲伺服器重置後遠端連結失敗的解決辦法
阿新 • • 發佈:2018-11-12
如題,最近雙11買了阿里雲伺服器,然後倒騰。
由於一系列我自己的無法理解的操作之後,恐將伺服器搞壞,打算重置伺服器。於是,進行了如下操作:
選中自己要重置的阿里雲服務例項-》停止例項-》更多=》磁碟和映象-》重新初始化磁碟
一波操作之後,重新啟動伺服器,然後準備右鍵新建遠端連線。開開心心準備通過ssh遠端連結伺服器。結果發現報錯如下:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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:M3gbfQPCs8Y/y07otgS5BtZM9kSrCGYznCdatU2XF2g. Please contact your system administrator. Add correct host key in/Users/zhangyanling/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /Users/zhangyanling/.ssh/known_hosts:2 ECDSA host key for 47.110.54.75 has changed and you have requested strict checking. Host key verification failed.
大概猜了一下原因,遠端host定義已經被更改。還是一臉懵逼啊,不說了,趕緊複製錯誤資訊搜尋一波。得到解決辦法如下:
地址連結: https://www.digitalocean.com/community/questions/warning-remote-host-identification-has-changed
ssh-keygen -R <host>
比如,
ssh-keygen -R 192.168.3.10
然後就搞定了!