Knowledge Base
Searching in : Article
ID: AR03C00168
Applies to: NoMachine Server
Added on: 2005-03-17
Last Update: 2016-12-21

How to change User Id (UID) and Group Id (GID) of the nx user on Linux

You cannot change username for the nx user, but you can have a specific User ID and Group ID set.  NoMachine setup uses system commands to add  the nx user and lets the system return the UID it likes most.  UID or user Id is the User Identifier, a unique positive integer assigned by the operating system to each user.

You can configure the user add command on the system to return the UID that matches your setup: this must be set before you install NoMachine.

Otherwise, you can change UID of the nx user after the NoMachine installation by following steps below.

1) Shutdown NoMachine server and services:

$ sudo /usr/NX/bin/nxserver --shutdown

2) Change the UID by hand or by using a system tool. For example:

$ sudo usermod -u 507  nx

3)  Update ownership and permissions of NoMachine files according to the new settings by running:

$ sudo /usr/NX/scripts/setup/nxserver --update

4) Restart NoMachine server and services:

$ sudo /usr/NX/bin/nxserver --restart


The Group Id  or GID  is the Group Identifier, i.e. a numeric value used to represent a group. It can be any group, as this information is not presently used by NoMachine, but it is advisable to set the nx user to the group root to make it harder for an attacker to change ownership of its files.

 


 

If you have a NoMachine server installed which supports web sessions and wants to change UID of  the nxhtd user, which is the owner of the NoMachine web server (nxhtd):

1) Shutdown NoMachine server and services:

$ sudo /usr/NX/bin/nxserver --shutdown

2) Change the UID by hand or by using a system tool. For example:

$ sudo usermod -u 507  nxhtd

3)  Update ownership and permissions of NoMachine files according to the new settings by running:

$ sudo /usr/NX/scripts/setup/nxwebplayer --update

4) Restart NoMachine server and services:

$ sudo /usr/NX/bin/nxserver --restart