Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to setup passwordless ssh on an Ubuntu server with ssh-copy-id myuser@myserver, but I'm getting the error:

Warning: the ECDSA host key for 'myserver' differs from the key for the IP address '192.168.1.123'

What's causing this, and how do I fix it? I tried deleting the .ssh directory on the remote machine, and running ssh-keygen -R "myserver" locally, but this doesn't resolve the error.

share|improve this question

3 Answers

Remove the cached key for 192.168.1.123 on the local machine:

ssh-keygen -R 192.168.1.123
share|improve this answer

(OK, to Mark0978 point, I have edited this to try to better answer the question)

Question: What's causing this, ... ?

So the ssh server host key changed. What caused the change? It is hard to say. Here are some guesses:

  • Did sshd on myserver start using ECDSA keys, so it is a new key type?
  • Was myserver recently re-installed?
  • Was sshd on myserver recently re-insalled so a new ssh host key was generated?
  • Did someone re-generate or replace the sshd host key?
  • Has the IP address of myserver changed so that a different host is answering to that IP address?

Question: ... and how do I fix it?

As others have already answered, remove the cached ECDSA host key for myserver that your account has cached.

share|improve this answer
Good advice, but doesn't actually answer the question. Doesn't even TRY to answer the question. – Mark0978 Apr 3 at 14:18

This thread may help:

http://www.linuxquestions.org/questions/linux-security-4/ssh-ecdsa-rsa-conflict-872520/

Essentially, you want to remove both the RSA and ECDSA keys for that host, then use ssh-keyscan to put them back into your known_hosts file in a way that won't cause this conflict. It worked for me when I had the same issue.

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.