markdown SSH远程主机标识已更改

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown SSH远程主机标识已更改相关的知识,希望对你有一定的参考价值。

After reinstalling my Raspberry Pi and connecting it again to the local network 
I got following message when trying to ssh through command line.
```
ssh pi@raspberrypi
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:U[---------------- hidden ---------------]A.
Please contact your system administrator.
Add correct host key in /Users/Friedrich/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/Friedrich/.ssh/known_hosts:4
ECDSA host key for raspberrypi has changed and you have requested strict checking.
Host key verification failed.
```

What I had to do was adding the new fingerprint to the list of known hosts:

```
ssh-keyscan -H raspberrypi >> ~/.ssh/known_hosts
```

Now logging in to my Raspberry Pi worked again but was followed by this prompt 
everytime I was connecting.
```
ssh pi@raspberrypi
Warning: the ECDSA host key for 'raspberrypi' differs from the key for the IP address '192.168.2.106'
Offending key for IP in /Users/Friedrich/.ssh/known_hosts:3
Matching host key in /Users/Friedrich/.ssh/known_hosts:10
Are you sure you want to continue connecting (yes/no)? yes
```

To fix it I repeated the previous step for the IP address which was given inside 
the promt message, too.
```
ssh-keyscan -H 192.168.2.106 >> ~/.ssh/known_hosts
```

以上是关于markdown SSH远程主机标识已更改的主要内容,如果未能解决你的问题,请参考以下文章

Ubuntu-ssh - - 警告:远程主机标识已更改 [关闭]

ssh 连接,known_hosts 为空,但我收到警告“远程主机标识已更改”并询问密码

ssh WARNING:REMOTE HOST IDENTIFICATION HAS CHANGED(警告:远程主机标识已更改)

ssh WARNING:REMOTE HOST IDENTIFICATION HAS CHANGED(警告:远程主机标识已更改)

如何摆脱“远程主机标识已更改”消息

警告:远程主机标识已更改 (1)