Running rsync over an SSH port forward

21 Oct 2015 08:26


I’m using bastion, and it’s slow to establish connections.


Use rsync without the implied -e ssh, and tunnel over an existing SSH connection.

So: establish an SSH connection, set up a port forward, run rsync as a daemon, and then minimize the terminal window.



Create rsyncd.conf as follows:

  path = .
  use chroot = no
  read only = no

The daemon

ssh -L8873:localhost:8873 REMOTE_HOST
rsync --daemon --no-detach --config=$PWD/rsyncd.conf --log-file=$PWD/rsyncd.log &
tail -f $PWD/rsyncd.log

The rsync

rsync SOURCE rsync://localhost:8873/foo/