NoMachine Support

Your questions answered

Knowledge Base

Searching in: Feature Requests
Filter the search results
Target version:
Products:
Status:
Last update:
Searching in: Feature Requests
ID: FR08R04011
Added on:  2020-08-06
Last update: 2020-08-06
Priority: High
Products: NoMachine Server
Target: 6
Status:  Approved
Forcing a system logout when the user disconnects from the physical display

In case of connections to the physical display of the remote computer, it can be convenient to force a system logout when the user closes the NoMachine session.

This feature applies to the Enterprise Desktop (used as a standalone server) and to  a multiserver environment in which the Enterprise Desktops are federated under a Cloud Server.

The system logout will be triggered by the execution of a script upon the closure of the NoMachine session. This script invokes the system command to force the logout, but it's up to administrators to specify the appropriate command to be used. Due to great variety of supported systems, the script provides by default just some most common examples.

This script, named forceLogout.sh, is placed under the NoMachine installation directory:
- /Applications/NoMachine.app/Contents/Frameworks/scripts/custom/forceLogout.sh on macOS
- /usr/NX/scripts/custom/forceLogout.sh on Linux
- %ProgramFiles(x86)%\\NoMachine\\scripts\\custom\\forceLogout.sh on Windows

How to enable the automatic logout upon disconnection

Let's distinguish two cases:

a) The Enterprise Desktop is used as a standalone server

b) The Enterprise Desktop is part of a Cloud Server multi-server environment (it's a child server of the Cloud Server).


Case a) Enterprise Desktop as a standalone server

1. Edit the forceLogout.sh script and specify the command to logout, appropriate for your operating system.

2. Edit the server.cfg file and enable the following key:

LogoutOnDisconnect 1

When this key is enabled, NoMachine will try to execute the forceLogout.sh script. The automatic logout will be effective only if the command set in the forceLogout.sh script is appropriate.
 

3. If you need to execute the logout after a certain period of time, enable also the following key and specify a time value in seconds. The logout command will be executed when the timeout expires:

LogoutOnDisconnectTimeout 0

This is the default, the command to logout is executed immediately.

To delay the execution of the command, set the timeout in seconds. For example:

LogoutOnDisconnectTimeout 600

NoMachine will wait for ten minutes before executing the command to logout. If the user connects again by NoMachine in the meantime, the command to logout will be not executed.

 

Case b) Enterprise Desktop being part of a multiserver environment

1. Edit the forceLogout.sh script on each Enterprise Desktop and specify the command to logout, appropriate for your operating system.

2. On the Cloud Server host, set the appropriate profile rule to enable the automatic logout upon disconnection. The rule will be propagated to all child servers' levels.

The rule can be applied

2.1. on a per-server basis:

nxserver --ruleadd --class feature --type enable-logout-on-disconnect  --value yes --server <server:port>|<uuid>

To disable it:

nxserver --ruleadd --class feature --type enable-logout-on-disconnect  --value no --server <server:port>|<uuid>

To delay the execution of the logout command, use the --timeout switch and specify the amount of seconds to wait before executing the logout command (by default the command is executed immediately). For example, to delay the execution of 20 minutes:

nxserver --ruleadd --class feature --type enable-logout-on-disconnect  --value yes --timeout 1200 --server <server:port>|<uuid>

2.2. or on a per-group of servers basis

Create the group of servers:

nxserver --servergroupadd SERVERGROUPNAME

and then apply the rule to enable the automatic disconnection for that group:

nxserver --ruleadd --class feature --type enable-logout-on-disconnect  --value yes --servergroup <groupname>

To disable the automatic logout:

nxserver --ruleadd --class feature --type enable-logout-on-disconnect  --value no --servergroup <groupname>

To delay the execution of the logout command, use the --timeout switch and specify the amount of seconds to wait before executing the logout command (by default the command is executed immediately). For example, to delay the execution of 20 minutes:

nxserver --ruleadd --class feature --type enable-logout-on-disconnect  --value yes --timeout 1200 --servergroup <groupname>


Notify me when the FR is implemented.