遠程連接服務器異常修復(WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!)

一、一開始使用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:JNXYj+PPQ7fUDo28A8wgRaLW+Tsvvduhf6UeG0RBZsA.
Please contact your system administrator.
Add correct host key in /var/root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /var/root/.ssh/known_hosts:1
ECDSA host key for 47.98.135.119 has changed and you have requested strict checking.
Host key verification failed.

一開始不知道爲什麼會提示:遠程主機標識已更改 但是仔細閱讀錯誤日誌會發現解決方法

二、解決方法,看錯誤日誌中有一句

Please contact your system administrator.
Add correct host key in /var/root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /var/root/.ssh/known_hosts:1

三、使用命令行進入這個文件中修改

cd ./.ssh 先進入到這個文件夾中
vim known_hosts 編輯這個文件
// 這裏我是用的mac操作的 

然後找到你的 阿里雲服務地址 開頭的哪一行 把它去掉 重新連接就可以了

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章