I'm using Ccygwin on WinXP (with the bash shell). I want to SCP a file from my localhost to a remote machine — host2. However, I can only SSH to an intermediate machine — host1, and then from there SSH to host2. (Note, I ccan't access host2 from my localhost).
I thought tunneling was my answer, but when I try to set up a tunnel
ssh -L 9999:localhost:9998 dalvarado@host1 'ssh -L 9998:localhost:1234 -N dalvarado@host2'
But after typing this command and hitting enter, the system just hangs. What is the proper way to setup a tunnel and then SCP a file after?
Thanks, –
Best Answer
This has already been answered best here.
To summarize: put the following in
~/.ssh/config
and then simply
scp
to target.machine any time you want to proxy via proxy.machine!Also works for
ssh
, so will save you time ssh-ing to the target machine too.Credit should go to user24925 who answered this in 2011.