How to solve the problem: "@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @"
Learn how to resolve the '@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!' issue by updating your known_hosts file to regain access to your VPS.
How to Solve the Problem: ”@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @”
Sometimes, after changing an OS or making modifications with a VPS or another service, you may encounter the following message:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 ED2519 key sent by the remote host is
SHA256:TD2it1ytkewtuktev+wksVGMmnhHe86ketfUkoqrwetmnK2w0.
Please contact your system administrator.
Add correct host key in /Users/user/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/user/.ssh/known_hosts:20
Host key for xxx.xxx.xxx.xxx has changed and you have requested strict checking.
Host key verification failed.
To access your VPS again, follow these steps:
-
Open the known_hosts file located at
/Users/user/.ssh/known_hosts(the path may vary for you).You can use the
nanoeditor, or any other text editor of your choice:nano /Users/user/.ssh/known_hostsSample content may resemble:
ssh-rsa AAAAB3NzaC1yc2EAAQEAy6jbeLh1mMiICjHuOjx5ui+66$ ecdsa-sha2-nistp256 AAAAEVjZHNhNoYTItbmlzdHAAAABBJZQq$ xxx.xxx.xxx.xxx ecdsa-sha2-nistp256 AA5AAEzdAAAtrlzdHA$ xxx.xxx.xxx.xxx ssh-ed25519 AAAAC3=NzaCZDI1NTE5AAdomnd$ xxx.xxx.xxx.xxx ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAtoiAU$ xxy.xxy.xxy.xxy ecdsa-sha2-nistp256 AAAAE2VjZHz7lzdHAy$ xxy.xxy.xxy.xxy ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AApY4I$ xxy.xxy.xxy.xxy ssh-rsa AAAAB3NzaC1yc2EAAAADAQ8ApoywI4$ -
Locate and delete the lines containing the IP address of your VPS. The quickest way is to go to the line and use Ctrl+K to cut it.
-
Exit the editor by pressing Ctrl+X and confirm saving changes by pressing Y.
-
Finally, reconnect to your VPS to continue your work.
Related Articles
Browse more articles in these categories.