ssh and rsyncd.conf

Tom Allen tallen at 10east.com
Wed Feb 25 14:54:57 GMT 2004


On Wed, 25 Feb 2004, Paul Slootman wrote:

> > How do I get rsync to transfer the files using the rules called out in the
> > rsyncd.conf file while using ssh?
>
> You'd have to forward the rsync port over an ssh connection:
>
>     ssh -L8730:127.0.0.1:873 host
>
> Then, (separately) use rsync like so:
>
>     rsync --port=8730 filename localhost::module_name
>
> and after the transfer stop the ssh session.
>
> but that's a rather roundabout method...
>

There's an easier method that's been covered a few times on this list,
using SSH keys and forced commands in the authorized_keys file.  Make a
keypair, and on the side you are backing up from add something like this
before the key entry:

command="/path/to/rsync --server --daemon --config
/path/to/rsyncd.conf",from="x.x.x.x"

Then wherever you are backing up to, you can do something like

rsync -e "ssh -2 -i key_file_here" user at host::module/
/destination/directory/

There's more sample info and some pitfalls you can avoid elsewhere on
this list, check the searchable archives at

http://marc.theaimsgroup.com/?l=rsync&r=1&w=2


Tom




More information about the rsync mailing list