Super User is a question and answer site for computer enthusiasts and power users. 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 shall try and be brief. English is my second language, so please forgive the lack of syntactic fluency.

I have done lots of researches but could not find a suitable article (perhaps because I am not using the appropriate search string). I would love an easy ready-made solution, however I am also keen on learning this stuff so I would be happy if someone could at least provide me a pointer.

I'll divide this into two categories: what I am currently doing and what I would like to do but have failed.

Two boxes running Ubuntu 10.04 - Box A (SSH client, Firefox, FoxyProxy) --> Box B (Running a security application - Apache port 8080) In order to bring the security app that is running on Box B to my Box A, I connect from A to B in those steps: Step 1: Command:

ssh -D 1080 <user>@<Box_B_IP>

Step 2: I would launch my local Firefox (running under Box A's) and, having FoxyProxy installed and configured to listen on port 1080, I make this my default proxy.

Step 3: I then simply type the server IP on my local browser (Box A's) specifying the port the application is listening on: 8080


This enables me to run the security application running under Box B as if it were sitting on my own client (Box A). This is all great except for the fact that my Box B is open to the world (OK there are iptables and firewalls, but that's beyond the point).

Thus, what I would like to do is to have a third box on the game, a 'jump' box in between Boxes A and B (call it Box X), so I can configure the iptables in Box B to only accept traffic coming from Box X, like this: A --> X --> B

My assumption is that from Box A I should SSH to Box X using a certain parameter to then SSH into Box B using another parameter to bind the ports and be able to run the security application that runs in B to A via X.

I tried all combinations of parameters like -D and -L and port bindings that my dumb brain could think of.

How can I achieve this? Any inputs would be highly appreciated.

share|improve this question

What I usually do is :

  1. Start ssh -D <local_port> <serverX>
  2. Configure your FoxyProxy (firefox) to use a socks5 proxy listening at localhost on port <local_port>
  3. Navigate to your usual <serverB> address, with the proxy active.

And voilà !

I'm still looking for an automated way to start the local proxy when I access a specific subdomain.

share|improve this answer
Thanks ever so much for the suggestion. I just read it and am on the move so can't test right now. But will definitely try it out and post another comment with the result. – Lex Feb 16 '13 at 18:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .