Showing posts with label ssh. Show all posts
Showing posts with label ssh. Show all posts

Monday, 17 May 2010

Mathematica through ssh tunnel

Although I don't use Mathematica, a colleague asked me for help on this. In our setting the licence server for Mathematica listens on port 16286, so to get a PC with Mathematica installed (but without a license) to access that license server we just need to do:

* locate the "mathpass" file in the PC and add the line

!localhost


* then create a ssh tunnel where the local 16286 port is redirected to the 16286 port in the license server.

And that's all. Now Mathematica at home works fine, but using the Mathematica licenses at work.

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
HostName vaso.myinstitute.org
User myuser

#Privoxy
LocalForward 8118 localhost:8118


With this in place, when we do "ssh work" from outside our network, we will connect to vaso.myinstitute.org 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 vaso.myinstitute.org (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 127.0.0.1 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.