20171217 SSH連現時出現「WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!」解決辦法

SSH連現時出現「WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!」解決辦法

解决方案:


會出現這訊息是因為,第一次SSH連現時,會生成一個認證,儲存在客戶端(也就是用SSH連線其他電腦的那個,自己操作的那個)中的known_hosts,但是如果伺服器端重灌過了,認證資訊當然也會更改,伺服器端與客戶端不同時,就會跳出錯誤啦~因此,只要把電腦中的認證資訊刪除,連線時重新生成,就一切完美啦~要刪除很簡單,只要在客戶端輸入一個指令

解决方法 ssh-keygen -R 伺服器端的IP或網址

OR :删除 .ssh/known_hosts 文件中对应的 IP 那一行。

在我的本地电脑上的画面提示命令是
ssh-keygen -f "/home/yang/.ssh/known_hosts" -R [176.122.189.45]:28352

找上面操作后,显示是 :

# Host [176.122.189.45]:28352 found: line 1

/home/yang/.ssh/known_hosts updated.

Original contents retained as /home/yang/.ssh/known_hosts.old


yang@yang-Inspiron-7577:~$ ssh -p 28352 [email protected]

The authenticity of host '[176.122.189.45]:28352 ([176.122.189.45]:28352)' can't be established.

ECDSA key fingerprint is SHA256:SdvJ0BQGnCiyUk4GyLNDvFSjXOqvSXm0ORrTL18ZE18.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '[176.122.189.45]:28352' (ECDSA) to the list of known hosts.


接下來在連線一次,會出現

Are you sure you want to continue connecting (yes/no)?

輸入yes,就完成連線啦!同時,新的認證也生成了



今天在處理Raspberry Pi(這機器好久沒上場了)的時候,想要用ssh來操控,沒想到連線時,出現「WARNING: REMOTE HOST

IDENTIFICATION HAS

CHANGED!」,後面還有一大串英文,這時當然要向Google大神求助啦!收尋了一下,終於被小弟找到原因了~

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@    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 the RSA host key has just been changed.

The fingerprint for the RSA key sent by the remote host is

這裡依每台電腦而不同

Please contact your system administrator.

Add correct host key in /home/conbar/.ssh/known_hosts to get rid of this message.

Offending key in /home/conbar/.ssh/known_hosts:10

RSA host key for 這裡是伺服器端的IP或網址 has changed and you have requested strict checking.

Host key verification failed.

你可能感兴趣的:(20171217 SSH連現時出現「WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!」解決辦法)