I’m trying to setup password-less 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?

Remove the cached key for 192.168.1.123 on the local machine:

ssh-keygen -R 192.168.1.123