You May have never see these following message before.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 ED25519 key sent by the remote host is
SHA256: Du5IfPbhi2Ap56XxXXXXXXXXXXXXXXs.
Please contact your system administrator.
Add correct host key in /Users/name/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/name/.ssh/known_hosts:105
Host key for 15.235.XXX.XXX has changed and you have requested strict checking.
Host key verification failed.
scp: Connection closed
What to do about this warning?
The message you're seeing indicates that the host key for the remote server has changed, and SSH is warning you to prevent a potential "man-in-the-middle" attack. To resolve this, you'll need to remove the old key for the server from your known_hosts file and then re-add the new one.
Here’s how to resolve this:
- Remove the Old Host Key
The message specifies that the old ECDSA key for the host is located at line 105 in your known_hosts file. You can manually remove this line, or use ssh-keygen to remove it.
To remove the key for the IP 15.235.XXX.XXX, use the following command:
ssh-keygen -R 15.235.XXX.XXX
This command removes the offending key entry from your ~/.ssh/known_hosts file.
- Add the New Host Key
Now, when you try to reconnect to the host, you will be prompted to accept the new key:
ssh username@15.235.XXX.XXX
When prompted with the new key, type yes to accept it. The key will automatically be added to your known_hosts file.
Alternatively, you can manually add the new key using ssh-keyscan:
ssh-keyscan 15.235.XXX.XXX >> /Users/name/.ssh/known_hosts
This will add the correct ED25519 key to your known_hosts file, and you won’t see the error again.
After completing these steps, try connecting again, and it should work without any errors.