-3

I want to ssh to Server-A which only accepts connections on port 1234. This port is blocked on my current network's firewall.

Server-B however, accepts ssh connections on standard port 22, and is able to reach Server-A via ssh on the alternate port 1234.

How can I create an ssh tunnel which will allow me to connect directly to Server-A on port 1234 using Server-B as a proxy?

Eaten by a Grue
  • 282
  • 4
  • 22
  • http://serverfault.com/a/66332/984 and http://serverfault.com/search?q=ssh+ProxyCommand – Zoredache Sep 19 '13 at 19:20
  • thank you! I added "ProxyCommand ssh -qxT Server-A netcat Server-B 1234" to my ssh config and this works perfectly. Am still curious about ssh tunnels which I don't really understand, or any other alternative methods if they exist. – Eaten by a Grue Sep 19 '13 at 19:37
  • Read the linked questions? There are answers that solve the problem with tunnels. – Zoredache Sep 19 '13 at 19:40
  • 3
    This question appears to be off-topic because it is about policy circumvention. Talk with your IT department if you need access to something the firewall doesn't currently permit. – EEAA Sep 19 '13 at 19:43

1 Answers1

1

Check this out:

ssh -L 12345:www.google.com:80 root@serverb

After doing this, you should be able to go to your browser and type localhost:12345 and www.google.com should come up. Hopefully that helps.

Jay
  • 36
  • 2
  • Thanks but how could you apply this to the above question? i.e., establishing an ssh connection, not an http browser connection. Sorry I just don't understand tunneling that well. – Eaten by a Grue Sep 20 '13 at 00:43
  • Yes... The samething works, but instead of www.google.com put that location that you desire. If you want services on another server, then that would be the way to forward the services from that server to you locally. – Jay Sep 20 '13 at 15:04