How to Fix SSH Host key verification failed on Linux


How to Fix SSH Host key verification failed on Linux

Are you getting SSH Host key verification failed errors when you trying to connect the server using ssh connection as shown below.

No need to panic about this errors, its a warning of hostname mismatching in the existing hostname in the known_hosts file. Just look at the last three line from the output which will give you the clear explaination.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
dc:7e:da:2d:14:aa:09:83:c9:dd:69:70:84:7d:2a:af.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:3
remove with: ssh-keygen -f "/root/.ssh/known_hosts" -R linux1
ECDSA host key for linux1 has changed and you have requested strict checking.
Host key verification failed.

This post will help you How to Fix SSH Host key verification failed on Linux.

How to Fix SSH Host key verification failed on Linux


Here is a solution to solve the errors.

Solution 1 : Just copy the command "ssh-keygen -f "/root/.ssh/known_hosts" -R linux1" as shows in the error and execute it.

Solution 2 : Open the /root/.ssh/known_hosts, search the hostname "linux1" as shows in the error and delete the lines.

Hope the post helped you to fix SSH Host key verification failed on Linux

Keep practicing and have fun. Leave your comments if any.

Support Us: Share with your friends and groups.

Stay connected with us on social networking sites, Thank you.

Post a Comment

0 Comments