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
I don't think my first posting on this was very clear. Let me try again.
I am trying to `rsync -e ssh' with a work machine "B" from my laptop at home. I only have direct access from home to work machine "A".
For ordinary use of `ssh' and `scp' I use port forwarding via "A" to "B" from my laptop when I use it from home. Thus, in the background on my laptop (when I'm home), I have running: `ssh -N A.WorkDomain -L N:B:22'
where N is the localhost (laptop) port number that I want to forward, and "A.WorkDomain" is the fully qualified name of my work machine "A". This allows me to do things like: `ssh localhost -p N' and `scp -P N localhost:/tmp/foo /tmp'
which then connects "directly" to "B" at work (via "A").
But now I need to rsync a directory on B to my laptop at home using `rsync -e ssh'.
Were my laptop at work, I'd just do (say): `rysnc -a -e ssh --delete B:/tmp/ /tmp/'
since from work I have direct access to "B". But from home I must do something like
rysnc -p N -a -e ssh --delete localhost:/tmp/ /tmp/
The problem is that there doesn't appear to be any such "port flag" for rsync. I just missing the flag among the gajillion or so rsync flags? If not, how does one do this?
Dean
At 8:12 PM -0700 10/5/07, Dean S. Messing wrote:
I don't think my first posting on this was very clear. Let me try again.
I am trying to `rsync -e ssh' with a work machine "B" from my laptop at home. I only have direct access from home to work machine "A".
For ordinary use of `ssh' and `scp' I use port forwarding via "A" to "B" from my laptop when I use it from home. Thus, in the background on my laptop (when I'm home), I have running: `ssh -N A.WorkDomain -L N:B:22'
where N is the localhost (laptop) port number that I want to forward, and "A.WorkDomain" is the fully qualified name of my work machine "A". This allows me to do things like: `ssh localhost -p N' and `scp -P N localhost:/tmp/foo /tmp'
which then connects "directly" to "B" at work (via "A").
But now I need to rsync a directory on B to my laptop at home using `rsync -e ssh'.
Were my laptop at work, I'd just do (say): `rysnc -a -e ssh --delete B:/tmp/ /tmp/'
since from work I have direct access to "B". But from home I must do something like
rysnc -p N -a -e ssh --delete localhost:/tmp/ /tmp/
The problem is that there doesn't appear to be any such "port flag" for rsync. I just missing the flag among the gajillion or so rsync flags? If not, how does one do this?
According to the rsync man page, something like:
rsync -a -e "ssh -p N" --delete localhost:/tmp/ /tmp/
Tony Nelson wrote : At 8:12 PM -0700 10/5/07, Dean S. Messing wrote: : >I am trying to `rsync -e ssh' with a work machine "B" from my laptop : >at home. I only have direct access from home to work machine "A". : > : >For ordinary use of `ssh' and `scp' I use port forwarding via "A" to : >"B" from my laptop when I use it from home. Thus, in the background : >on my laptop (when I'm home), I have running: : >`ssh -N A.WorkDomain -L N:B:22'
<snip>
: >from home I want to do something like : > : >rysnc -p N -a -e ssh --delete localhost:/tmp/ /tmp/ : > : >The problem is that there doesn't appear to be any such "port flag" : >for rsync. Am I just missing the flag among the gajillion or so : >rsync flags? If not, how does one do this?
: According to the rsync man page, something like: : : rsync -a -e "ssh -p N" --delete localhost:/tmp/ /tmp/
How obvious! (I was looking for an rsync port flag.) Thanks Tony.
Dean