===== Running MATLAB using SSH tunneling to access EECS license server ===== With SSH tunneling, MATLAB license requests are forwarded from your computer's local ports 1726 and 1727 over a secure Internet connection via indigo to port 1726 and 1727 on our license server. === Linux / MacOS X === * Create a new MATLAB license file called localhost.lic in in your home directory. with the following contents. * **Note:** With MATLAB R2017A and newer, if your localhost.lic file has **localhost** on the **SERVER** line, it should be replaced with IP number **127.0.0.1**. Failure to make this change will result in a license error. SERVER 127.0.0.1 000102030405 1726 USE_SERVER * Use the following shell script **''connect-matlab-license-server.sh''** to establish an SSH tunnel connection to the departmental licence server. Save the file in your home directory. //**Be sure to replace EECS-USERNAME with your EECS username**// #!/bin/sh echo Forwarding local ports 1726:1727 to license server ssh -2 -N -x -L 1726:licenseserv.eecs.yorku.ca:1726 \ -L 1727:licenseserv.eecs.yorku.ca:1727 EECS-USERNAME@indigo.eecs.yorku.ca * Run the script from the command line to create a SSH tunnel chmod 755 connect-matlab-license-server.sh ./connect-matlab-license-server.sh When you run the script you will be prompt for a password, enter your EECS account password. You are now connected to the EECS license server. * Start MATLAB, using our SSH tunnel. == MacOS X == /Applications/MATLAB_R2018a.app/bin/matlab -c ~/localhost.lic == Linux == matlab -c ~/localhost.lic === Windows === * **Create new network license files:** * License paths for MATLAB: C:\Program Files\MATLAB\\licenses\network1.lic C:\Program Files\MATLAB\\licenses\network2.lic **Note:** You can rename the existing **network.lic** to **network1.lic** **network1.lic contents:** SERVER licenseserv.eecs.yorku.ca 000102030405 1726 USE_SERVER **network2.lic contents:** SERVER 127.0.0.1 000102030405 1726 USE_SERVER * Launch a text editor (Not MSWord) and save the following content into a file called **connect-matlab-license-server.cmd** on your desktop. //**Be sure to replace EECS-USERNAME with your EECS username**// @echo off echo Forwarding local ports 1726:1727 to license server echo Close this Command Prompt window to terminate session! if exist "%ProgramFiles(x86)%\PuTTY\plink.exe" set PLINK="%ProgramFiles(x86)%\PuTTY\plink.exe" if exist "%ProgramFiles%\PuTTY\plink.exe" set PLINK="%ProgramFiles%\PuTTY\plink.exe" %PLINK% -2 -N -x -L 1726:licenseserv.eecs.yorku.ca:1726 -L 1727:licenseserv.eecs.yorku.ca:1727 EECS-USERNAME@indigo.eecs.yorku.ca * Use batch script connect-matlab-license-server.cmd you just saved to establish a SSH tunnel connection to the departmental licence server. \\ PuTTY can be downloaded from [[http://www.chiark.greenend.org.uk/~sgtatham/putty|http://www.chiark.greenend.org.uk/~sgtatham/putty ]]. * Before you start MATLAB, double click on the connect-matlab-license-server.cmd icon on the desktop. The first time you connect, you will be prompted to save the server key into your local cache. Enter your password when prompted. * **Note:** With this setup you will experience a delay when you launch MATLAB if you are not connected to EECS's wired network.