See this post first as it’s the first step to this setup:
Steps to Perform SSH Login Without Password Using ssh-keygen & ssh-copy-id
#sudo visudo on the terget box
at the bottom add:
username_that_logs_in_to_ssh_from_source ALL=NOPASSWD: /usr/bin/rsync
to your rsync command add:
--rsync-path="sudo rsync"
full example:
rsync -avz --delete --rsync-path="sudo rsync" /var/www/sites/ target_host:/var/www/sites/This entry was posted in Linux. Bookmark the permalink.