Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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

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


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.

share|improve this question

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


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.