I have followed the following guide to setup Rsync with SSH between my local machine and a remote server:
I performed the below as root:
-
rsync -avz -e ssh /home/user/dir root@192.168.200.10::Backup/dir
-> prompts for password -
ssh-keygen
-> Key generated -
ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.200.10
-> confirmation that keys were copied -
ssh 192.168.200.10
-> Accesses the remote server without promting for password -
rsync -avz -e ssh /home/user/dir root@192.168.200.10::Backup/dir
-> Prompts for password
Is it not strange that I can SSH into the remote server without being prompted for the password but do when using rsync?
I can see .ssh/authorized_keys
on the remote server.
Where am I doing wrong?
Best Answer
You are mixing two separate connection modes: with a remote shell (
-e ssh
) and without a remote shell, thru arsync daemon
(identified by the double colon).The manual states:
Probably the simplest way to obtain passwordless authentication for you is to modify the command above as follows: