Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am able to use ssh from terminal but I am not able to use it from "connect to Server.." utility. it is showing the error in the dialog box as below:

Cannot display location "sftp://username@IP.IP.IP.IP:PORT/
"Host key verification failed"

Why so?

From terminal using below command I am able to access the server:

ubuntu# ssh -p 2222 username@IP.IP.IP.IP

Description:    Ubuntu 10.04.4 LTS
Release:    10.04
Codename:   lucid

Why is the host key verification failing?

share|improve this question
    
Do you know where unity stores its authorized keys? Is it in the user dir or a system dir? Basically you have to flush/delete the entry for the key of the other server (assuming it has legitimately changed). –  niallhaslam Oct 18 '12 at 9:25
    
I know that but I dont know where it stores the authorized key. –  rambo Oct 18 '12 at 9:49
    
yepii... I solved it. i just change known_hosts file. ubuntu#mv known_hosts known_hots_ and there you go. It is working now. thank you ubuntu. –  rambo Oct 18 '12 at 10:21

1 Answer 1

There is a file called known_hosts, typically in the user directory ~/.ssh/ - this contains the keys that ssh and other services use to authenticate remote machines that you connect to. If the key for a particular server has been updated for example during an update of the OS then a new key for that server will be generated on that server. Since this conflicts with the stored key on your machine ssh will ask if you still trust that machine.

The first time you connect to a machine ssh will ask you if you trust that key. If you do then that key is copied to the known_hosts file for that user.

Look in the known_hosts file and remove the entry for the remote machine. Now when you connect you should be asked to accept the new key. By moving the file, you will probably have triggered the creation of a new known_hosts file for the first key that you import and will have lost the records of the other machine you may have connected to.

share|improve this answer

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.