SSH Host Verification Failed Error Fix

By Randy Jensen | Jan 14, 2009

Ubuntu LogoA couple weeks ago I showed you how to share files between two Ubuntu computers. Well yesterday I decided to install Windows 7 Beta on my secondary machine, that was running Ubuntu and had the share I created in that post. Since the computer is pretty old, I decided to just wipe the drive and install Win7 natively, rather than in a VM.

After I was done with some testing, I threw Ubuntu back on the machine and setup my shared folder again with the exact same name. Then I reconnected my main machine to the share with SSH, but was greeted with this error
SSH Verification Failed

Basically what’s happening is that when you create an SSH connection, ‘authentication’ keys are created on the host machine (the machine with the shared folder on it). Since I had wiped Ubuntu and reinstalled, I obviously reinstalled SSH and then created my share again, but with different keys since they are randomly generated. So now when my main computer is looking for this share, it’s finding it, but not able to verify the keys that it currently thinks are correct and then create the secure connection…and SSH is pretty worthless with the ’secure’ part:) Luckily, there is an incredibly easy fix for this.

If You Have Only One SSH Connection

If you are only running one SSH connection you can simply run this command from the terminal
sudo rm .ssh/known_hosts

This command is going to go into your SSH folder in your Home directory and delete the Known Hosts file that tells the server connection what the keys for the shared folder should be. Again, these keys have changed because we reinstalled SSH on our machine and the keys were once again, randomly generated.

If You Have Multiple SSH Connections

Run this in the terminal
sudo gedit .ssh/known_hosts

You will be presented with something similar to this the image below. Delete the connection that you no longer want to use (in my example you would be deleting connection 2)
SSH Connections

That’s pretty much all you have to do. Your connection should now work again.


  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Design Float
  • DZone
  • Ping.fm
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis
  • Yahoo! Buzz
Copy the code below to your web site.
x 

Related posts:

  1. VirtualBox VERR_VM_DRIVER_NOT_INSTALLED (rc=-1908) Error I recently installed the updated kernel in Ubuntu 8.10....
  2. Using Pandora’s Windows Vista Gadget I recently bought a new computer that is running Windows...
  3. Unable to Lock Download Directory When Updating Ubtunu Sometimes when you’re trying to either use the Update manager...

Related posts brought to you by Yet Another Related Posts Plugin.

blog comments powered by Disqus
© 2009 Randy Jensen Online, - PassionDuo WordPress Theme