1

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

$ ssh root@machine.local
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 root@machine.local:/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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.