0

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.

masegaloeh
  • 18,236
  • 10
  • 57
  • 106

2 Answers2

0

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.

womble
  • 96,255
  • 29
  • 175
  • 230
0

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.

womble
  • 96,255
  • 29
  • 175
  • 230