I can connect to another Ubuntu machine in my LAN via SSH. On both of then PC's I installed openssh-server but from another Ubuntu computer I can not connect to my PC via SSH and I got this error:
Host key verification failed...
|
I can connect to another Ubuntu machine in my LAN via SSH. On both of then PC's I installed openssh-server but from another Ubuntu computer I can not connect to my PC via SSH and I got this error:
|
||||
migrated from stackoverflow.com May 28 '11 at 12:38This question came from our site for professional and enthusiast programmers. |
||||
|
"Host key verification failed" means that the host key of the remote host was changed. Ssh stores the host keys of the remote hosts in ~/.ssh/known_hosts. You can either edit that text file manually and remove the old key (you can see the line number in the error message), or use
(which I learnt from the answer to Is it possible to remove a particular host key from SSH's known_hosts file?). |
|||||||||
|
|
If you are running in certain remote/scripting situations where you lack interactive access to the prompt-to-add-hostkey, work around it like this:
Warning: Permanently added 'something.example.com,10.11.12.13' (RSA) to the list of known hosts. |
|||||||||||||||||
|
|
Also sometimes there is situation when you are working on serial console, then checking above command in verbose mode
In above case just remove
As an alternative, add |
|||||
|
|
In my case, this was caused by a udev problem - there was no
|
||||
|
|
|
Well, it simply because the second ubuntu requires connection by key and not password. I suggest you use Second possibility is that there's already a key for your other ubuntu in you PC, and that it changed thus being not recognized anymore. In this case, you'll have to edit the file |
|||
|
|
|
This is an old thread and I just ran across this answer, I will just add what I did to solve this.
I just looked at the error message that it threw at me and it said to run that command in order to remove it from the list of hosts. After that I did the following:
Than I followed the prompts from there until I was able to ssh into the server. |
|||||
|
|
Its means your remote host key was changed (May be host password change), Your terminal suggested to execute this command as root user
You have to remove that host name from hosts list on your pc/server. Copy that suggested command and execute as a root user.
Hope this works. |
|||
|
|
|
You should change your key in this way: From your given error find which host-key changed for example: Offending ECDSA key in /Users/user-name/.ssh/known_hosts:5 said 5th key changed, so do this:
Notice: you must be root or have privilege for sudo. |
|||||||||
|
|
On terminal:
The following message, or similar, will appear:
Then, connect to your EC2 as normal:
|
|||
|
|
|
|
|||||
|
|
you have to put the rsa key of the target host into the source host
|
||||
|
|
|
My solution comes from this blog post: Algorithm negotiation failed for SSH Secure Shell Client You need to modify the file as follows:
And then add the following:
Basically you tried different solutions until you find one which can solve your problem. If the above solutions don't work, please try this one. If this one doesn't work as well, please try others. |
||||
|
|
sshfrom the command-line. – MarkHu Mar 31 '17 at 17:19