rsync over ssh with post-zfer

Wayne Davison wayned at samba.org
Fri Sep 9 11:57:07 MDT 2011


On Fri, Sep 9, 2011 at 3:56 AM, Ben Short <ben at benshort.co.uk> wrote:

> The following is my rsyncd.conf file in my home directory on the server.
>

Since you are running rsync as root, the config file used will be
/etc/rsyncd.conf.  I assume that config file is simply missing the post-xfer
exec setting, unlike the one in the home dir.  If you want to use a
different config file, you'd have to pass in the --config=/some/rsyncd.conf
option to remote rsync.

I've added the following to the sudoers file so that the rsync daemon runs
> as root and can preserve the file permissions.
>
> bs ALL= NOPASSWD:/usr/local/bin/rsync
>

It would be safer to force the whole "rsync --server --daemon ." command via
sudoers so that a non daemon-server rsync cannot be run as root.  You may
also want to add a forced command to your ssh key in the authorized_keys
file so that that particular ssh key can only be used to startup a root
rsync server daemon.  If you go that route, you wouldn't need to use the
--rsync-path option on the client (since you would force sudo as part of the
command) and you could make the forced command specify any config file you
like (if you want to switch from the default global config).

..wayne..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20110909/45ba6e9e/attachment.html>


More information about the rsync mailing list