Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed a new server but now I'm not able to ssh into the server from my Ubuntu 9.04 machine. I get the following error

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
Please contact your system administrator.
Add correct host key in /home/myname/.ssh/known_hosts to get rid of this message.
Offending key in /home/myname/.ssh/known_hosts:29
RSA host key for 10.x.x.1 has changed and you have requested strict checking.
Host key verification failed.

I have never experienced a problem like this before

share|improve this question
up vote 2 down vote accepted

It seems like the machine RSA security key has been compromised or changed, which is normally the case with a new installation. On your local machine you need to remove this machine from the known_hosts file and then try and connect. This should ask you to generate a new SSH key.

You can use vi to edit the file directly.

vi /home/myname/.ssh/known_hosts

share|improve this answer

The SSH key has changed on your server, and that is why your SSH client is prompting you about this potential risk, as well as not allowing you to connect.

Did you reinstall the machine or SSH on the server lately? Or did you regenerate the SSH password? Could it really be someone has hacked in? Well doesn't matter, the first thing you need to do is to access the machine first before you can find out more.

To do that, you will need to go to the client, and remove the known_hosts file.

rm ~/.ssh/known_hosts

It should be okay to do so, and the next time you connect, the client will regenerate a new known_hosts file.

share|improve this answer
If you have a huge list of known_hosts deleting it will require everyone to be regenerated, and is not entirely ideal every time. Editing is simpler - Sometimes – BinaryMisfit Sep 8 '09 at 8:31
@Diago : true, i'm the lazy man who just let everything regenerate once in awhile. :) – caliban Sep 8 '09 at 8:36

Did you try do what message assumes? Try to remove old server record from /home/myname/.ssh/known_host at line 29.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .