Re: scp via a intermediate computer
- From: Joachim Gann <joachim.gann@xxxxxxxxx>
- Date: Sun, 25 May 2008 15:16:01 +0200
Peng Yu wrote:
Hi,
For some reason, I can only access computer A through computer B. That
is, suppose my computer is C, I can ssh to B from C, but I can not ssh
to A from C. Once I login computer B, I can ssh to A from B.
I'm wondering how to use port forwarding on B such that I can scp from
A to C. Otherwise, I'll have to scp files from A to B and then B to C,
which is too annoying.
Would you please let me know the command so that I can scp A to C
without creating any temporary files on B?
Thanks,
Peng
assuming your ssh daemons listen on port 22
1. choose an unused tcp port on B, say 1111
2. on A: ssh -nR 1111:C:22 B &
this sets up port forwarding from B:1111 to C:22, you need this once.
it tells you the pid on startup, you can kill the process once you don't need the forwarding anymore
note that B must be able to resolve the hostname "C" to an IP address
3. now on A: scp -P 1111 something B:
your scp now connects to B:1111 which has been forwarded to C:22
step 3 might need an "-o stricthostkeychecking=no" since scp believes it is connecting to B but through the forwarding is actually talking to C, which should have a different host key.
Regards
Joachim
.
- Follow-Ups:
- Re: scp via a intermediate computer
- From: Peng Yu
- Re: scp via a intermediate computer
- From: Peng Yu
- Re: scp via a intermediate computer
- From: Paul Hink
- Re: scp via a intermediate computer
- References:
- scp via a intermediate computer
- From: Peng Yu
- scp via a intermediate computer
- Prev by Date: scp via a intermediate computer
- Next by Date: Re: scp via a intermediate computer
- Previous by thread: scp via a intermediate computer
- Next by thread: Re: scp via a intermediate computer
- Index(es):
Relevant Pages
|