The Blog

RSYNC over ssh with sudo to preserve permissions and ownership Posted on

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.

Please Post Your Comments & Reviews

Your email address will not be published. Required fields are marked *



CAPTCHA
Change the CAPTCHA codeSpeak the CAPTCHA code