Happened just at the end of Pi Wars 2024.
Apparently for some reason a different IP address was assigned to the Raspberry Pi
To Fix:
- Connect to RPi with a screen and keyboard, Open a terminal
- Identify new IP address with:
$ ip address
...
3: wlan0:
...
inet 192.168.8.179/24 brd ...
...
So it is now 192.168.8.179
(it used to be 192.168.8.170
)
- In the host computer edit
.ssh/config
to replace old IP with new IP
$ sudo nano .ssh/config
# Read more about SSH config files: https://linux.die.net/man/5/ssh_config
Host sevillabot
HostName 192.168.8.179
User mhered
...
- Try to connect, it will complain that you are renaming a known host, and ask you to remove the old key:
$ ssh mhered@sevillabot
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:***************************************
Please contact your system administrator.
Add correct host key in /home/mhered/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/mhered/.ssh/known_hosts:6
remove with:
ssh-keygen -f "/home/mhered/.ssh/known_hosts" -R "192.168.8.179"
ECDSA host key for 192.168.8.179 has changed and you have requested strict checking.
Host key verification failed.
$ ssh-keygen -f "/home/mhered/.ssh/known_hosts" -R "192.168.8.179"
# Host 192.168.8.179 found: line 6
/home/mhered/.ssh/known_hosts updated.
Original contents retained as /home/mhered/.ssh/known_hosts.old