Thursday, 4 February 2010

Accessing your Intranet via Privoxy

At our workplace we have several webpages that are filtered by IP. If you don't want to use VPNs, then you can access them easily via a ssh tunnel and privoxy.

This is actually quite easy. Just install privoxy in the machine inside the local network (with Ubuntu this is already pre-packaged for you, so just run Synaptic Package Manager and install it). It is normally configured to run automatically after every reboot, and that is just fine. It is also configured to listen in the 8118 port.

So now, if we are outside our local network, we can create a ssh tunnel. We can do this with a config file like this:

$ cat .ssh/config
Host work
User myuser

LocalForward 8118 localhost:8118

With this in place, when we do "ssh work" from outside our network, we will connect to and at the same time we will create a tunnel in which all requests to local port 8118 will in fact be redirected to port 8118 in (where privoxy is running).

Now in the PC outside the local network, just get Firefox with FoxyProxy (some details to configure this are in previous post:BBC iPlayer Overseas) and create a proxy configuration for Privoxy, where the IP address is and the port 8118. When you activate this configuration (if you have the ssh tunnel in place), all your traffic will be as if inside the local network.

No comments: