Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

We have a trusted machine which is authorized to connect to a special web service on port 12345, as shown below. The web service whitelists specific clients, and only those IP addresses are allowed to connect.

[ restricted-access ]       [ trusted machine ]
[    web service    ] <===> [                 ]
[ ]       [    ]

My machine is authorized to connect to the trusted machine:

[ restricted-access ]       [ trusted machine ]           [    my box   ]
[    web service    ] <===> [                 ] <--ssh--> [             ]
[ ]       [    ]           [ ]

I have a script foo.rb which tries to connect to It fails, since I'm not authorized to connect to directly. Only the trusted box at can do this.

How do I set up an SSH tunnel so that the script can successfully make the connection?

share|improve this question
What will you be using to connect? Putty? Or SSH on a terminal? – Nick Oct 8 '10 at 17:24
up vote 4 down vote accepted

Figured it out. I used:

ssh -f -N -L

I then edited my hosts file so that requests to go the proxy. Crude but effective.

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.