SSH Tunnel Problem

Wayne Davison wayned at
Sun Dec 19 16:55:38 GMT 2004

On Sat, Dec 18, 2004 at 07:28:24PM -0800, d c wrote:
> HOWEVER-  I cannot connect "passwordless" with SSH and then connect to
> the rsync daemon.

If you combine daemon-syntax with ssh, you spawn a new rsync daemon that
will be run by the ssh program, so it needs its own rsyncd.conf file
(which must be in the logged-in user's home directory by default).  If
you want to talk to an existing rsync daemon using an encoded socket,
you need to use some kind of tunnel, such as this one using ssh:

ssh -f -i ~/.ssh/id_dsa -C -l SOMEUSER -L 8730:localhost:873 SOMEHOST sleep 40
rsync -av rsync://localhost:8730/module /dest

That will connect to port 8730 on the localhost, which ssh forwards over
its connection to SOMEHOST, and that machine then connects to port 873
on "localhost".  Changing the "localhost" in the -L option would change
what machine the remote end of the tunnel connects with, which would
allow you to ssh into REMOTEHOST and have it connect to port 873 on some
other machine on REMOTEHOST's network.  If you're using the ssh2
protocol, you should also be able to use the -N option to ssh instead of
the "sleep 40" command.


More information about the rsync mailing list