Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I got this error.
can anyone help?

Add correct host key in /home/sam/.ssh/known_hosts to get rid of this message.
Offending key in /home/sam/.ssh/known_hosts:2
RSA host key for 192.168.1.3 has changed and you have requested strict checking.
Host key verification failed.
share|improve this question
add comment

4 Answers

The message means that the SSH key for the server you are trying to connect to has changed since the last time you connected there.

If that server was re-installed (or got its keys regenerated for some reason), all you need to do is edit your .ssh/known_hosts file and remove the offending line (the one that mentions that server). Make sure you check the key signature when you reconnect before you save it when SSH asks you to.

If the server was not touched however, you have an issue: your .ssh/known_host was corrupted somehow, or the server was compromised, or someone's trying to mount a man in the middle attack.

share|improve this answer
add comment

Just to be clear, ssh implements server authentication by verifying this key. This is a security measure. Before taking action to reset the key, you should make sure you are actually connecting to the machine you think you are. If your network were hacked, you could be ignoring evidence of that event.

share|improve this answer
add comment

Open the file, and delete the second line, and save it

vi /home/sam/.ssh/known_hosts +2
dd
:x
share|improve this answer
add comment

192.168.1.3 looks like an IP address of a machine in a home network. The most likely reason is that you've previously SSH'd to an other machine with the same IP assigned.

In that case, you can safely remove line 2 of ~/.ssh/known_hosts.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.