Hello kgrzeska,
Custom commands are not sent to custom scripts, so there is no way to control allowed commands from custom scripts, there is other way to control allowed commands. Our products: NoMachine Terminal Server, NoMachine Enterprise Server and NoMachine Cloud Server support profiles feature. Profiles can be used to define allowed command. The general format of the command is:
nxserver --ruleadd --class session --type unix-script --value value OPTIONS
value must be path to allowed command, e.g. /usr/bin/firefox.
OPTION can be any of the following options:
--system
set the rule on a per-server basis. The rule will be applied to the whole NX System and to every user accessing it
--user USERNAME
set the rule on a per-user basis. The rule will be applied to the specified user only
--guest
the rule will be applied to all guest users and will not affect other users. Guest accounts are available only on Linux.
--node NODE
set the rule for the specified NODE only
--group GROUP
set the rule for the specified GROUP.
Here are some examples how to set allowed commands using profiles:
This command will set firefox as allowed command for user: adam :
nxserver --ruleadd --class session --type unix-script --value /usr/bin/firefox --user adam
This command will set firefox as allowed command for group: adam :
nxserver --ruleadd --class session --type unix-script --value /usr/bin/firefox --group adam
This command will set firefox as allowed command for everyone:
nxserver --ruleadd --class session --type unix-script --value /usr/bin/firefox --system