RSync + SSH tunneling through firewall

Paul Slootman paul at
Wed Sep 8 10:12:10 GMT 2004

On Wed 08 Sep 2004, Stefaan Lhermitte wrote:

> I tried to connect the tunnel with another port number. When I use port 
> number 22 instead of 873 I can telnet to C from B.
> When I telnet I get  "SSH-1.99-OpenSSH_3.9p1."

Yes, because you are connecting via the tunnel to the ssh server on C

> Subsequently I ran: ssh -v -L 22:C-computer:22 myname at B-computer
> When I run now the rsync command:
> rsync -v /cygdrive/d/folder/
> I get the error: "failed to connect to Connection refused."

Yes, because you are trying to connect to an rsync server
(NOT ssh server!) and there isn't an rsync server running on
localhost... (873 isn't forwarded either).

> When I run:
> rsync -v --port=22 /cygdrive/d/folder/
> I get the error "server sent SSH-1.99-OpenSSH_3.9p1 rather than greeting"

That's because you're telling rsync to connect to the ssh server, for
some reason...

> I assume it is a problem associated with the telnet command. Can anyone 
> help?

It's your thinking...
If you don't want to connect to an rsync server, don't use "host::"
Use a single : to connect via ssh (assuming a recent rsync that defaults
to ssh instead of rsh...)

Paul Slootman

More information about the rsync mailing list