I am trying to get rid of these annoying message

Warning: the ECDSA host key for 'mysub.domain.de' differs from the key for the IP address 'XXX.XXX.XXX.XX'
Offending key for IP in /home/thisuser/.ssh/known_hosts:15
Matching host key in /home/thisuser/.ssh/known_hosts:19
Are you sure you want to continue connecting (yes/no)?

I think the problem is caused by docker running on the Server. Connecting with SSH to the server itself is fine, i don't get any warning.

But if i ssh to the docker container the keys doesn't match, maybe the docker container (gitea in this case) has a different key.

I don't like the option: StrictHostKeyChecking no

Is there another option to get rid of the message but keep checking the keys?

  • Try to copy /etc/ssh/ssh_host_* keys to /etc/ssh/ in your docker container and restart ssh on it. Then, remove not used keys from your /home/thisuser/.ssh/known_hosts file. – Dexter Morganov Oct 12 '18 at 9:01

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.