validating a Gurobi academic license remotely, via ssh (SOCKS)
AnsweredHow do I validate my Gurobi academic license remotely, that is, from a computer that is not on my university network?
Official instructions for Gurobi 9.1 are here: https://www.gurobi.com/documentation/9.1/quickstart_mac/academic_validation.html, but these require a VPN.
There are old instructions for using an ssh tunnel on the (retired) google group https://groups.google.com/g/gurobi/c/MaEP4cun8o8?pli=1, but these no longer work.
Instead of a VPN, one can apparently use an ssh SOCKS proxy. This worked for me as of January 2021. Specifically, commands for enabling a SOCKS proxy on my mac are:
sudo networksetup -setsocksfirewallproxy 'Ethernet' 127.0.0.1 4088
sudo networksetup -setsocksfirewallproxy 'Wi-Fi' 127.0.0.1 4088
ssh -N -D 4088 <remote host>
Then, in a separate terminal window, run grbgetkey as usual.
grbgetkey <LICENSE KEY>
There are more complicated instructions for doing it via socks proxy without using grbgetkey at https://medium.com/@drfyp/validating-an-academic-gurobi-license-through-a-socks-proxy-on-macos-740f7d9527b4 that also worked for me as of January 2021. For the record, I'll try to paste an abbreviated version of those here:
[first, connect to a the remote computer via ssh SOCKS proxy,
see elsewhere, or the link above, for instructions on that]In a text editor, write the following link:
http://apps.gurobi.com/keyserver?id=<key>&hostname=<hostname>&hostid=<hostid>&username=<username>&os=mac64&localdate=<date>&version=<version>
Where:
<key>
is a valid academic key obtained freely from the Gurobi website.<hostname>
is the hostname of the computer you’d like to create a license for.<hostid>
is the last 4 bytes of your computer’s MAC address in hexadecimal notation (e.g 2b90abcd).<username>
is your user name on the computer for which you are requesting a license.<platform>
is a string used by Gurobi to identify the OS of your computer (e.g. linux64).<date>
is today’s date in YYYY-MM-DD notation.<version>
is the version of Gurobi (e.g. 9)Part of the information can be obtained by using the following command in the terminal of your computer:
grbprobe
You get something like:
info : grbprobe version 9.0.0, build v9.0.0rc2
HOSTNAME=JohnDoe-MacBook-Pro.local
HOSTID=2b90abcd
PLATFORM=mac64
USERNAME=johndoe
CORES=4CPU=Intel(R) Core(TM) i7–4870HQ CPU @ 2.50GHzThe final link should be like:
http://apps.gurobi.com/keyserver?id=61329999–9999–9999–9999-020d093b9999&hostname=JohnDoe-MacBook-Pro.local&hostid=2b90abcd&username=johndoe&os=mac64&localdate=2019-12-13&version=9
Open this link in your browser, you get a text like:
RESULT=0 LICENSEID=389999 # DO NOT EDIT THIS FILE except as noted # # License ID 389999 TYPE=ACADEMIC VERSION=9 HOSTNAME=JohnDoe-MacBook-Pro.local HOSTID=2b90abcd USERNAME=johndoe EXPIRATION=2020-12-12 KEY=SK9ABC9V CKEY=SK9ABC9V
Copy this text in a new file with the following format, and save it as
gurobi.lic
in the home user directory of your computer:# DO NOT EDIT THIS FILE except as noted
#
# License ID 389999
TYPE=ACADEMIC
VERSION=9
HOSTNAME=JohnDoe-MacBook-Pro.local
HOSTID=2b90abcd
USERNAME=johndoe
EXPIRATION=2020-12-12
KEY=SK9ABC9V
CKEY=SK9ABC9VYou should now be able to use Gurobi.
-
I couldn't get these instructions to work. (on Catalina, it seems opening a new terminal window doesn't give the terminal the proxy information... and I was still getting the 'not an academic domain' error) But this led me to an easier fix...
$ ssh -N -D 4088 user@host.edu
Then in another terminal
$ export HTTP_PROXY=socks5://127.0.0.1:4088
$ grbgetkey --http --verbose <LICENSE KEY>You can probably get this to use https too if you setup the https_proxy variable, but I didn't try that.
1 -
Hi Neal!
Please open a ticket if you have difficulties with \(\tt{grbgetkey}\) or your license. We are always happy to get people up and running with Gurobi.
Cheers,
Matthias0
Please sign in to leave a comment.
Comments
3 comments