I need to make a tunnel from a client box to a server. The problem is that there are 2 boxes between them:

CLIENT --- FIREWALL ---{ SERVER1 --- SERVER1.2 }

CLIENT ============================= SERVER1.2

I know how to do it when I have just one box in between:

CLIENT --- FIREWALL ---{ SERVER1 }

CLIENT ==================SERVER1

From the client box :

ssh -l **user_firewall** -L 8112:**server1_ip**:22 **firewall_ip** cat -

And then :

ssh -C -c arcfour256 localhost -l **user_server1** -p 8112

Would anybody please be able to provide some insight into this problem. If you need more info I can glady provide it. Thanks.

link|improve this question
feedback

2 Answers

I'd be inclined to use ProxyCommand -- as long as you've got netcat installed on the intermediate boxes, you can basically plow through as many layers as you need to.

I could give you an example, but the one in the ssh_config(5) man page does the job admirably.

link|improve this answer
feedback

Finally I got this working. Thanks @womble!

I modified the /.ssh/config :

Host server1
Hostname server1_ip
User server1_user
ForwardAgent yes
Port 22
ProxyCommand ssh -oCiphers=arcfour128,arcfour256,arcfour,blowfish-cbc firewall_user@firewall_ip nc %h %p

Host server12
Hostname server12_ip
User server12_user
ForwardAgent yes
Port 22
ProxyCommand ssh -oCiphers=arcfour128,arcfour256,arcfour,blowfish-cbc server1 nc %h %p

Now, when I type ssh server12 from the client, I have a shell in the server12, jumping firewall and server1.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.