Mini How To – Fixing SSH offending key errors


Sometimes when you SSH into a computer for example

ssh 191.168.1.67

your get an error message similar to that below:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@ 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 the RSA host key has just been changed.

The fingerprint for the RSA key sent by the remote host is

b2:35:85:d3:e6:84:42:b8:3e:8f:e1:ae:54:dc:68:22.

Please contact your system administrator.

Add correct host key in /home/hostname/.ssh/known_hosts to get rid of this message.

Offending key in /home/hostname/.ssh/known_hosts:6

RSA host key for 191.168.1.67 has changed and you have requested strict checking.

Host key verification failed.

To fix edit /home/hostname/.ssh/known_hosts

In this particular example we are told that the offending key is in line 6 of the file, by the line in the original message "Offending key in /home/hostname/.ssh/known_hosts:6"

Delete line 6

Save the file.

Enter your ssh command again

ssh 191.168.1.67

You will now get the message

The authenticity of host ‘191.168.1.67 (192.168.1.67)’ can’t be established.

RSA key fingerprint is b2:35:85:d3:e6:84:42:b8:3e:8f:e1:ae:54:dc:68:22.

Are you sure you want to continue connecting (yes/no)?

Reply yes

You will then get the message

Warning: Permanently added ‘191.168.1.67’ (RSA) to the list of known hosts.

and will then be asked fro your password.

=-=-=-=-=
Powered by Blogilo

Advertisements

One thought on “Mini How To – Fixing SSH offending key errors

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s