I've managed to do ssh tunnel just for two hops
ssh -L 1234:serverB:22 user@serverA
scp -P 1234 user@localhost:/file /file
Now I need to go from localhost -> serverA - >serverB ->serverC
And to copy files between localhost and serverC
I've managed to do ssh tunnel just for two hops
ssh -L 1234:serverB:22 user@serverA
scp -P 1234 user@localhost:/file /file
Now I need to go from localhost -> serverA - >serverB ->serverC
And to copy files between localhost and serverC
This way:
ssh -L 1234:localhost:1234 user@serverA
Then, from serverA:
ssh -L 1234:serverC:22 user@serverB
So your local port 1234
will tunnel to serverA
, from which it will tunnel to serverB
, and finally to sercerC:22
.