After creating a key with no password, I can login with SSH to my remote host:

$ ssh [email protected]
Welcome to Ubuntu 14.04.1...

However when I try to use SSH to rsync to the same remote host:

$ sudo rsync -avczr -e ssh /home [email protected]:/destination

it asks for my root password on machine.local.

Why does SSH want to login with password for rsync, but with key if I connect directly? How do I make the rsync connection work with key?

One thing I noticed, which may be related, is that the first "authenticity of host can't be established" message I received mentioned the ECDSA key fingerprint, while the key I use for connecting directly are RSA.

1 Answer 1


It turned out the problem was that I called rsync with sudo and was therefore running it as root. Therefore ssh called via rsync did not use my user's ~/.ssh/id* files, but looked for /root/.ssh/id_* and found none.

I copied the ~/.ssh/id* files to /root/.ssh/, and now it works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .