15
9
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, -
From user Meir D: Also see http://serverfault.com/questions/337274/ssh-from-a-through-b-to-c-using-private-key-on-b
– fixer1234 – 2017-01-19T18:37:29.267Possible duplicate of scp files via intermediate host
– tripleee – 2018-04-16T07:30:29.2732
Duplicate of http://superuser.com/questions/174160/scp-over-a-proxy-with-one-command-from-local-machine - see my answer below for a summary.
– jmetz – 2012-08-01T20:51:33.547