This is no Mathematica-language specific question but rather a network problem, so if this is the wrong place to ask, I apologize.

I am running Mathematica on Windows 7, the license manager mathlm is running in a local network. How can I access Mathematica when being outside the local network. Is there some tool like license checkout for let's say two hours?

If this is not possible with Mathematica, is there some way to forward the ports for license manager via ssh and are there problems/restrictions with Windows 7? Btw, contacting the server via ssh is possible.

  • 2
    $\begingroup$ Ask your organization/university if they have a virtual private network (VPN) set up (many do). This is a very common way to work around problems like this. After connection to the VPN it'll appear as if you were on the local network. $\endgroup$
    – Szabolcs
    Commented Dec 3, 2012 at 14:52
  • $\begingroup$ In general, VPN is a reasonable approach, but in this case it won't work. I'm still inside the network of the university (where I could enter via VPN), but as long as I am connected via WIFI, I don't have access to the institute's license server (though I can access it via ssh). Any other ideas? $\endgroup$
    – kromuchi
    Commented Dec 3, 2012 at 14:57
  • $\begingroup$ Well, it is always possible to forward ports using ssh, but I have no experience with license servers, so I don't know what server Mathematica would try to connect to (you have to get it to try to connect to your own machine after forwarding the ports). There are lots of tutorials on how to forward ports, here's the first one from google: debianadmin.com/… Sorry I can't help more. When I tried to use port forwarding to connect to a remote kernel (not license manager), it was always a lot of trouble. $\endgroup$
    – Szabolcs
    Commented Dec 3, 2012 at 15:01

2 Answers 2


Thanks to @halirutan and @Szabolcs, I found a working solution by myself. Apparently it won't work with localhost on Windows7 but with

To sum up, I present the ssh-commands, so other users might gain something from this (use your own network names or IPs here):

  1. First connect through the firewall via ssh.server: ssh -L 16286: [email protected]
  2. then forward to another gateway, where you can switch ports again: ssh -L 16286:mathlm.server:16286 second.gateway.server

Use either cygwin or putty, (and make sure, you run them as with sufficient rights -- e.g. as Administrator).

Then you have to enter ! in your mathpass file (or enter once Mathematica asks you for the license server).

  • $\begingroup$ I'm confused about the second gateway server. This means I need two extra computers apart from the local mathematica-running one and the license server? ssh.server would be the one in the LAN that can access mathlm.server, and then I need to go on to another server, second.gateway.server? $\endgroup$ Commented Dec 18, 2016 at 16:35
  • 1
    $\begingroup$ Not necessarily. It depends where you can tunnel into your network and how your network is configured. Sometimes the first command is sufficient, replacing with your gateway server $\endgroup$
    – kromuchi
    Commented Dec 19, 2016 at 12:10
  • $\begingroup$ Oh man, thank you! That I've tried out so many combinations that I didn't remember not trying that one... it'll be a while before I can get my mind around what is really what with the ssh forwarding commands. $\endgroup$ Commented Dec 19, 2016 at 14:11

You question does basically not fit here, but I'm sure it is still one of the best places to ask. I think we shouldn't be too pedantic with the rules. Let me give you some advice, which will unfortunately only help you, if you can cooperate with your admin of the server:

  • You have to ensure, that you can reach the license server over an IP, because this is what you will write in the mathpass file. If the license-server does run in a local network and has no public IP and you want to access it from anywhere public, I think the usual way will not work.

  • You have to ensure, that you can reach the license-server over the port 16286! Since you can access it over ssh it seems this port is not open to the outside world. In our setting at university, the firewall has to know every pc which wants to access the license server.

  • You maybe already know, that you then have to use the IP of the license server in your mathpass file by entering something similar to


  • 2
    $\begingroup$ OK, basically I had all requirements fulfilled, but you gave me the right hint. For port forwarding, I used localhost what -- appareantly -- won't work on Windows 7. Instead you have to use To sum up, I present the ssh-commands, so other users might gain something from this: First connect through the firewall via ssh.server ssh -L 16286: [email protected] and then forward to another gateway, where you can switch ports again ssh -L 16286:mathlm.server:16286 second.gateway.server. Use either cygwin or putty. $\endgroup$
    – kromuchi
    Commented Dec 3, 2012 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.