SSH遠程鏈接服務器出錯

場景緩存

某日線上排查問題,在堡壘機上面經過SSH鏈接其它服務器時報錯(報錯信息以下),遂始查,遍尋baidu、google,都是說要重置用戶目錄下的ssh文件夾,我以爲這樣作很不妥,舉個例子,你不能由於系統的記事本不能用了,就重裝系統吧?服務器

報錯信息app

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 RSA key sent by the remote host is
SHA256:*******
Please contact your system administrator.
Add correct host key in /Users/apple/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/apple/.ssh/known_hosts:17
RSA host key for [***ip address***] has changed and you have requested strict checking.
Host key verification failed.

出現緣由ssh

看錯誤描述,應該是SSH用到的RSA祕鑰出了問題,突然想起,前幾日要鏈接的這個服務器作了SSH模塊升級,相比也是重置了祕鑰,因此堡壘機下緩存的公鑰應該是無效的,因此沒法鏈接到對應服務器this

解決方法google

編輯堡壘機用戶目錄下的ssh文件夾中的know_hosts文件,刪除對應IP的公鑰記錄便可~code

相關文章
相關標籤/搜索