rsync and ssh port forwarding

Dean S. Messing deanm at sharplabs.com
Sat Oct 6 01:48:07 UTC 2007


I must ssh to a remote machine B by port forwarding via machine A.
Thus, in the background on the local machine, I have running:

ssh -N A.WorkDomain  -L  N:B:22  

where N is the localhost port that has been forwarded.

This allows me to do things like
`ssh localhost -p N'  and  `scp -P N localhost:/tmp/foo /tmp'

I now want to rsync a directory on B to my local machine using
`rsync -e ssh'

At work I'd just do (say) :

rysnc -a -e ssh --delete B:/tmp/ /tmp/

But from home it seems that I must do something like

rysnc -a -e ssh -p N --delete localhost:/tmp/ /tmp/

The problem is that there doesn't appear to be any such rsync flag.

Or am I just missing the flag among the gajillion or so rsync flags?

Dean




More information about the fedora-list mailing list