If you try to connect to a remote host using ssh and get a message like this:
❯ ssh ruben@<external_host>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:F9FN2+cJ1CS7c6yuNosfnAsBXkf5Mp+aDFe8CsotC73.
Please contact your system administrator.
Add correct host key in /Users/ruben/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/ruben/.ssh/known_hosts:39
Host key for <external_host> has changed and you have requested strict checking.
Host key verification failed.
You have two possible methods to fix it:
Option 1
- The warning message shows us that the issue is located in line 39 of the kown_hosts file.
- Deleting that file should fix the warning.
Option 2
- ❯ ssh-keygen -R <external_host>