Fix SSH Warning: "REMOTE HOST IDENTIFICATION HAS CHANGED!" on Ubuntu
When connecting to a remote server via SSH, you may encounter the following error:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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:istmAF2wJhtvFvwasrVw4HGbqvFvkNrb1dPWZapxruM. Please contact your system administrator. Add correct host key in /home/yourusername/.ssh/known_hosts to get rid of this message. Offending ED25519 key in /home/yourusername/.ssh/known_hosts:18 remove with: ssh-keygen -f '/home/yourusername/.ssh/known_hosts' -R '192.168.101.71' Host key for 192.168.101.71 has changed and you have requested strict checking. Host key verification failed.
What Does This Mean?
This warning appears when the host key of the remote server has changed. It may be caused by:
- The remote server was reinstalled or reset
- The IP address is now used by a different machine
- (Rare) A man-in-the-middle attack attempt
Safe Solution (for Local or Trusted Networks)
If you are sure the machine at 192.168.101.71
is safe (for example, your own VM or server), then you can remove the old key by running:
ssh-keygen -f "/home/yourusername/.ssh/known_hosts" -R "192.168.101.71"
Then try connecting again:
ssh ubuntu@192.168.101.71
SSH will ask you to confirm the new key:
The authenticity of host '192.168.101.71 (192.168.101.71)' can't be established. ED25519 key fingerprint is SHA256:istmAF2wJhtvFvwasrVw4HGbqvFvkNrb1dPWZapxruM. Are you sure you want to continue connecting (yes/no)?
Type yes
, and SSH will work as expected.
Security Reminder
If you're not sure whether the remote server is safe, do not proceed! Verify with your network administrator or ensure the remote IP hasn't been compromised.
Hope this helps you fix the SSH host verification issue!
0 Comments:
Post a Comment