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
```