rsync and tunneling via ssh

Dan Pritts danno at
Thu Aug 26 15:31:14 GMT 2004

On Thu, Aug 26, 2004 at 05:14:53PM +0200, Jean-Gabriel Duquesnoy wrote:
> Hi,
> I have setup a rsync server with a rsync running as a deamon, due to security
> rules I cannot open the rsync standard port (873) in the firewall.
> We have to tunnel rsync through ssh.
> On the client side, which is linux kernel 2.4 I have made the following script,
> but
> ssh -i /home/ifao/bin/traveltest -f -C -L
> cytric at localhost sleep 1000

You are sshing from localhost to localhost, and then trying to forward
localhost port 2211 to port 8730.

This means that the ssh server on localhost will try to send the
traffic to port 8730 on, which is presumably on the
other side of your firewall.

Probably what you want is:

 ssh -i /home/ifao/bin/traveltest -f -C -L
 cytric at sleep 1000

Or maybe 

 ssh -i /home/ifao/bin/traveltest -f -C -L 2211:localhost:8730
 cytric at sleep 1000

but it probably makes no difference.

You might (or might not) want to use the -N option to ssh instead
of using a "sleep 1000" command.

I also wonder why you're bothering with client/server mode - you might
as well just use plain old rsync over ssh.

dan pritts                                       danno at
systems administrator                            734/352-4953 office
internet2                                        734/834-7224 mobile

More information about the rsync mailing list