rsyncing as root when root login is disabled?

Joe Ruby joeat303 at
Sat Sep 16 17:40:45 GMT 2006

Joe Ruby wrote:
> I'm trying to do a simple rsync:
> rsync -av admin at .
> But a number of files in /backup are readable only
> root, and hence rsync gives these errors:
> sync: send_files failed to open
> "/backup/etc/mail/virtusertable.db": Permission
> (13)
> Since root login is disabled, I can't simple do
> 'root at'. I searched a bit and saw
> rsync -av --rsync-path='sudo path'
> admin at .
> I tried it -- rsync asks for my password, but then
> doesn't output anything after many minutes (after
> which I kill it).
> So, how can I rsync files from my remote server so
> the files are readable and the existing permissions
> get preserved (e.g. not having to do 'chmod -R a+r
> /backup'.

Perhaps what you have shown in your email is
incomplete, but based on what you 
have written, you have replaced the remote rsync with
sudo. Instead you need to 
invoke rsync using sudo by giving a command to sudo.
You might be able to do 
that using the --rsync-path argument like
--rsync-path='<sudo path> rsync', I 
have not tried it. Or you could write a wrapper.
Google "rsync wrapper".


I tried again:

$ rsync -av --progress --rsync-path='sudo
/usr/bin/rsync' admin at var

rsync: connection unexpectedly closed (0 bytes
received so far) [receiver]
rsync error: error in rsync protocol data stream (code
12) at /SourceCache/rsync/rsync-24/rsync/io.c(359)
$ 12345
-bash: 12345: command not found

I also Googled for 'rsync wrapper', but haven't found
anything yet that seems to address the problem I'm


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the rsync mailing list