Well, I'm working with virtual machines and I was trying to establish connection between client and server by ssh (from client to server). I installed ssh in both machine and I restarted too. It was not a problem. But, when I tried to connect from client with:

ssh -p 22 myservername@myserverip

It said: "Host key verification failed". It's always the same, whatever I've done.

This is the second time I've tried it (I uninstalled the two ubuntus and installed again)

What could I do to establish that connection?


When you reinstall a machine it gets a new ssh host key, but the old one is still stored in your key file.

Open ~/.ssh/known_hosts with an editor and remove the lines containing the problematic host keys.

You'll be asked to verify the new host keys the next time you connect.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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