Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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