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

As always, understand what changed.

Did the two hosts start using ECDSA keys, so it is a new key type? or did the host key change? Why? Was openssh-server upgraded and the key re-generated or a new ECDSA key generated?

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.