How to manage root<-->root rsync keeping permissions?

Chris Green cl at
Tue Aug 3 10:48:31 UTC 2021

Chris Green via rsync <rsync at> wrote:
> Is there a way to copy (for example) the /etc hierarchy from one
> system to another preserving root ownership of files and without
> revealing root passwords all over the place?
> This is actually from and to Debian based systems (from Raspberry Pi
> to Xubuntu) so there's no actual root user login anyway, it's all sudo
> from privileged user.
> So, it's easy for the sending end to be run as root as it's going to be
> run by a script in /etc/cron.daily, so it can access all the files in
> /etc even if only readable by root.
> But how do you handle the other end to restore the root ownership etc.?
> The script has to do something like:-
>     rsync -a /etc/ chris at remote:backups/etc/
> So at the remote end it only has chris' privileges.
> I want to automate this, I don't want any manual intervention to be
> needed.

If I used the --super option (in a command like the one above) and
chris can run rsync as root on the remote end (via options in the
sudoers file) will this do what I want?  I guess I can go away and try
it! :-)

Chris Green

More information about the rsync mailing list