Tunneling to freedom (well Apex anyway)






Firewalls, firewalls, firewalls... the bane of my life.

Here's a useful trick using ssh tunneling to bypass firewall rules and let you access what you need to without being blocked.

To do this you'll need an ssh client that has the tunneling feature, personally i use  (putty) which is a fantastic tool.

In this example i want to access a website running on http://webserver:7777/apex. However that port isn't open and the firewall blocks it. However the ssh port (22) is open and i can use this to enable me to get to port 7777. To make this work you have to have a user account that can access the webserver at the o/s level. In my case it's a linux server so my linux login will do.

So first up - fire up the putty GUI and enter the following information:




So just the webserver name and the default ssh port of 22. Once you've done that open up the ssh link in the bottom left and choose the tunnels part:




In here choose a local port that is free on your desktop/laptop machine I've chosen 7777 to match the remote webserver but it doesn't need to be. Then fill in the desitination - so for me thats webserver:7777 and click add which moves the config into the box above (note the L prefix on 7777 which shows it is the local port on the desktop).

Once you've done that you just need to click open as normal and log on with your linux username/password.

Now as long as your putty session remains open the following will happen:

All traffic sent to desktop:7777 is routed through the putty tunnel and sent to webserver:7777. What use is this you might ask?

We'll after you've set all this up try going to the url http://127.0.0.1:7777/apex and voila!

This will all work find as long as all url references are relative and there is no hardcoded links to the webserver name.

This can also work 'indirectly' - if you have a linux server you can reach and this server can 'see' the webserver it can be used as a pass through in the same way.

Happy tunneling....

0 comments:

Post a Comment