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

Roman Fiedler roman.fiedler at
Fri Dec 12 11:56:24 GMT 2008

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)
Ssh connect to bridge with tunnel for next ssh
Ssh connect to DST host via bridge.

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) 

Is there a posibility to make this work (mis-)using some command line 
parameters, e.g. -e or --sender?

thanks, roman

More information about the rsync mailing list