MATLAB: How to prevent users from running lmdown, lmremove, or lmreread from a client machine

MATLAB

Currently users can use the lmdown, lmremove, or lmreread commands from their client computers to affect the operation of the network license manager on the remote server. I would like to prevent them from using these commands.

Best Answer

By default, the usage of lmdown, lmremove and lmreread can be performed by any user with access to the network license manager. To restrict these functions see the information below:
On Windows, the lmtools.exe utility contains options to prevents users from stopping the license manager, removing licenses, or rereading the license.dat and options files. These options can be accessed by following these steps:
1. Launch $MATLAB\etc\win{32|64}\lmtools.exe. ($MATLAB\flexlm for releases prior to 2010b
2. Choose the "Start/Stop/Reread" tab.
3. Click the Advanced settings button to expand the options.
NOTE: $MATLAB refers to the installation folder for MATLAB on the license manager.
Under Start Server Options there are three checkboxes which can be checked to prevent lmdown from being run on any machine other than the one running the license manager, disable lmdown or lmreread.
For a Unix/Linux/Mac system there are command line switches to prevent access to lmdown, lmremove and lmreread. To use these switches, the license manager must be started with the lmgrd binary directly. You will not be able to use lmstart or lmboot to make these changes. To start the license manager with lmgrd, you must use the following command:
$MATLAB/etc/$ARCH/lmgrd - c <path to license file> -l <path to log>
- $MATLAB refers to the installation folder for MATLAB on the license manager
- $ARCH refers to the folder for the architecture you are using (Ex: glnx86, glnxa64, maci, sol, etc.)
- "path to license file" refers to the path of the license file on the computer
- "path to log" refers to the path of the log file that will be written (The default log is /var/tmp/lm_TMW.log)
For example, to start the license manager on 64-bit Linux:
/usr/local/matlab/etc/glnxa64/lmgrd - c /usr/local/matlab/etc/license.dat -l /var/tmp/lm_TMW.log
Once you change the method of starting the license manager, you can use the following flags with lmgrd to restrict usage:
-x lmremove: Disables lmremove function
-x lmdown: Disables lmdown completely (license manager process must be killed manually)
-local: Restricts access to lmdown to the computer where lmgrd is Running
-2 -p: The -2 -p switch restricts usage of lmdown, lmreread, and lmremove to a FLEXlm administrator who is by default root.
For the -2-p option, if there a UNIX group called lmadmin, then usage is restricted to only members of that group. If root is not a member of this group, then root does not have permission to use any of the above utilities. With this configuration, users attempting to change the license manager who are not part of the lmadmin group will receive the following error message:
Shutdown failed: You are not a license administrator (-63,214)