Rsync via two ssh tunnels possible (standard method mentioned k times not possible?)

Hendrik Visage hvjunk at
Thu Dec 18 08:22:30 GMT 2008

On Fri, Dec 12, 2008 at 12:56 PM, Roman Fiedler
<roman.fiedler at>wrote:

> Hi list,
> After reading rsync docu and doing online search, I still failed to find a
> simple solution for following problem:
> The goal is to sync two directories using rsync without running the rsync
> daemon on one of the two hosts. The standard shell sync does not work
> because of the network topology:
> Ssh connect to SRC-Host
>       ^
> Base host (with ssh keys)
>       v
> Ssh connect to bridge with tunnel for next ssh
>       v
> Ssh connect to DST host via bridge.

On DST, do a rsync --daemon, and let it only listen to local host for
connections etc. in the rsyncd.conf

setup the tunnel(s) to DST:873 (The rsync port??) from base on like port

Then ssh to SRC, with port forwarding from SRC:5555 to base:4444 executing
"rsync sourcedir rsync://localhost:5555/destinationdir"

Anything else, you'll have to vi rsync.c and add it yourself ;^)

> No direct connection SRC/DST is possible, the ssh keys only reside on base
> host and cannot be copied to any other host.
> My idea was to create ssh tunnels (plain port forward) from DST:4444 to
> base:5555, base:5555 to SRC:6666 (result tunnel DST:4444->SRC:6666) and run
> on SRC:
>  nc -lp 6666 -e rsync --server -a . .
> and something like that at DST
>  rsync -a rsync://localhost:4444/ .
> but that fails on src side with:
>  protocol version mismatch -- is your shell clean?
>  (see the rsync man page for an explanation)
>  rsync error: protocol incompatibility (code 2) at compat.c(61)
> [receiver=2.6.9]
> Is there a posibility to make this work (mis-)using some command line
> parameters, e.g. -e or --sender?
> thanks, roman
> --
> Please use reply-all for most replies to avoid omitting the mailing list.
> To unsubscribe or change options:
> Before posting, read:<>

Hendrik Visage
-------------- next part --------------
HTML attachment scrubbed and removed

More information about the rsync mailing list