I'm trying to set up rsync to copy the data from a server every day. In order to make the system as restricted as possible, I'm trying to use the mode described in the man page as: "USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION"
So I've put a file called rsyncd.conf in roots home folder:
[root]
path = /
read only = true
and tried to copy /etc/passwd over as a test:
rsync -vv -e ssh myserver::root/etc/passwd .
But I get the following:
opening connection using: ssh myserver rsync --server --daemon .
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(635) [receiver=3.0.3]
The reason I am doing all this is that once I get it working, I plan to restrict access by specifying the command
rsync --server --daemon .
in ~/.ssh/authorized_keys