Re: scp via a intermediate computer
- From: Joachim Gann <joachim.gann@xxxxxxxxx>
- Date: Tue, 27 May 2008 08:28:10 +0200
Peng Yu wrote:
On May 25, 6:16 am, Joachim Gann <joachim.g...@xxxxxxxxx> wrote:Peng Yu wrote:Hi,assuming your ssh daemons listen on port 22
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
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
Hi Joachim,
Assuming, A->B->C, where '->' means "can access". I tried
2. on A: ssh -nR 1111:C:22 B
This would prompt me to type passwd for B but not C.
Now enter the password for B. Leave the connection open. Read up the -R option in the ssh manual, to give yourself some clue on what you're doing. Then proceed with 3 in a new terminal session or window.
I am used to using key authentication so I am not being asked for a password and put the step 2 ssh command in the background with &.
Joachim
.
- Follow-Ups:
- Re: scp via a intermediate computer
- From: Peng Yu
- Re: scp via a intermediate computer
- References:
- scp via a intermediate computer
- From: Peng Yu
- Re: scp via a intermediate computer
- From: Joachim Gann
- Re: scp via a intermediate computer
- From: Peng Yu
- scp via a intermediate computer
- Prev by Date: Re: Row and Column Size
- Next by Date: Re: scp via a intermediate computer
- Previous by thread: Re: scp via a intermediate computer
- Next by thread: Re: scp via a intermediate computer
- Index(es):
Relevant Pages
|