rsync over ssh

Wayne Davison wayned at
Wed Apr 30 06:49:54 EST 2003

On Tue, Apr 29, 2003 at 11:49:07AM -0700, Dave Gawlik wrote:
> WARNING: --rsh or -e option ignored when connecting to rsync daemon

This is the error message that older rsync programs would output if you
tried to combine -e with host::module syntax, so you must be running an
older rsync from cron (perhaps due to a different PATH setting).

A more modern rsync will take the combination of the 2 and use ssh to
start up a single-session daemon that only serves the other end of the
ssh connection -- i.e. it does not allow you to contact an
already-running daemon on the remote side.  So, this command:

> rsync "--rsh=/usr/bin/ssh -L 23:$REMOTE:23" \
> -azR --verbose --progress --stats --force --bwlimit=64 \

Is probably not be doing what you think -- it is using ssh to run its
own daemon process, and while that it running the telnet port is being
redirected between the two systems (which has no effect on rsync).

One way to run this would be for the user to log into the daemon server,
and then run ssh with port-forwarding in reverse.  For instance, if you
wanted to run "rsync $SERVER::$MODULE $SYNCTO" (where $SYNCTO is on
$CLIENT), log into the $SERVER machine, and then run this command:

ssh -R8873:localhost:873 $CLIENT rsync rsync://localhost:8873/$MODULE $SYNCTO

This makes ssh keep the connection open for as long as rsync needs it
because rsync is being run by ssh.  (And forwarding port 8873 on the
$CLIENT side instead of 873 means that you don't need to be root.)

Other solutions are also possible, such as running a background ssh with
port forwarding, running rsync, and then killing the ssh (all from the
client side).


More information about the rsync mailing list