How to use different keys or certificates with NoMachine
Table of Contents
Introduction
1. NoMachine Keys and Certificates
How to Replace Default Keys and Certificates
2. The SSL certificate for nxd
3. The SSL certificate for nxhtd
4. The RSA Key Pair for the Terminal Server Nodes
5. The RSA Key Pair and the SSL certificate for the Failover Cluster
6. The RSA Key Pair for the Cloud Server's Nodes
6.1. Direct connection: add the Cloud Server key to the node
Introduction
1. Keys and Certificates
Keys and Certificates are used to secure the communication between two entities. In a NoMachine infrastructure, communications are established between:
- the end-user's device (NoMachine client or the browser) and the NoMachine server to which the user connects;
- the end-user's device and the end-point host machine, e.g. a NoMachine server federated under a Cloud Server;
- the Cloud Server and the NoMachine servers which are nodes of this Cloud Server;
- the Enterprise Terminal Server and its Enterprise Terminal Server Nodes ;
- two NoMachine servers in a failover cluster.
All these communication channels are encrypted and protected by Certificates or pairwise Keys provided with the NoMachine installation. If you may wish to replace any of them with your own Keys and Certificates, please follow instructions in the next sections.
Some remarks:
- All instructions are intended to be run from console and require an account with administrative privileges: 'root' on Linux and Mac (use a 'sudo' user if you don't have the 'root' account on your system and add the sudo prefix to all commands) and an administrator user on Windows. On Windows, execute the CMD shell as administrator.
- Instructions use the NoMachine nxkeygen tool, as an alternative, you can use the standard ssh-keygen command from OpenSSH on Linux and macOS.
On Windows you can use for example PuTTYgen (https://www.puttygen.com). You need to ensure that the key-pair is in OpenSSH format or convert it. To do that choose the key file in the PuTTYgen main window. Then go to Conversions->Export OpenSSH key to export your private key and save it. - By default, keys and certificates are generated by nxkeygen with 2048 bit lenght, specify the -n option for a different lenght.
- Instructions refers to installation directory which is the installation directory of the NoMachine server, by default:
/usr/NX on Linux
/Applications/NoMachine.app/Contents/Frameworks/ on macOS
%PROGRAMFILES%\NoMachine\ on Windows
2. The SSL certificate for nxd
The nxd program is the NoMachine Network Daemon resident on the server host (any of the NoMachine servers and the Enterprise Terminal Server Node) necessary to accept connections through NX protocol. Its SSL certificate is made of:
installation directory/etc/keys/host/nx_host_rsa_key.crt
installation directory/etc/keys/host/nx_host_rsa_key
Using a certificate and keys issued by Certificate Authority is not currently supported.
How to generate and use a new certificate and private key
STEP 1- generate a new certificate and private key for nxd. The general format of the command is:
installation directory/bin/nxkeygen -k privatekey -c certificate [-n length]
On Linux it's necessary to set LD_LIBRARY_PATH, i.e. :
$ LD_LIBRARY_PATH=/usr/NX/lib/ /usr/NX/bin/nxkeygen -k nx_host_rsa_key -c nx_host_rsa_key.crt -n 4096
Similarly, on macOS:
$ LD_LIBRARY_PATH=/Applications/NoMachine.app/Contents/Frameworks/lib/ /Applications/NoMachine.app/Contents/Frameworks/bin/nxkeygen -k nx_host_rsa_key -c nx_host_rsa_key.crt -n 4096
On Windows:
$ %PROGRAMFILES%\NoMachine\bin\nxkeygen -k nx_host_rsa_key -c nx_host_rsa_key.crt -n 4096
Ensure that the new certificate and key have the same name of the original ones and proper permissions and ownership.
On Linux they should look like:
-rw------- 1 nx root 1675 2013-11-18 12:18 nx_host_rsa_key
-rw-r--r-- 1 nx root 1090 2013-11-18 12:18 nx_host_rsa_key.crt
and on macOS:
-rw------- 1 nx wheel 1679 Apr 8 16:21 nx_host_rsa_key
-rw-r--r-- 1 nx wheel 1090 Apr 8 16:21 nx_host_rsa_key.crt
Restarting nxd is not necessary.
STEP 2- For web sessions it's necessary to update the client.crt by adding content of the new certificate nx_host_rsa_key.crt.
The certificate is:
/var/NX/nxhtd/.nx/config/client.crt on Linux
/Library/Application\ Support/NoMachine/var/nxhtd/.nx/config/client.crt on Mac
C:\ProgramData\NoMachine\nxhtd\.nx\config\client.crt on Windows.
For example, instructions on Linux if the new certificate is placed in /usr/NX:
$ echo "Host:localhost" > /var/NX/nxhtd/.nx/config/client.crt
$ cat /usr/NX/etc/keys/host/nx_host_rsa_key.crt >> /var/NX/nxhtd/.nx/config/client.crt
$ echo "Host:127.0.0.1" >> /var/NX/nxhtd/.nx/config/client.crt
$ cat /usr/NX/etc/keys/host/nx_host_rsa_key.crt >> /var/NX/nxhtd/.nx/config/client.crt
Both entries for Host:localhost and Host:127.0.0.1 must be present in client.crt which should look like:
Host:localhost
-----BEGIN CERTIFICATE-----
MIIC9zCCAd+gAwIBAgIRAP4YLqSxLm9xey/k41vmu+cwDQYJKoZIhvcNAQEFBQAw
(......)
-----END CERTIFICATE-----
Host:127.0.0.1
-----BEGIN CERTIFICATE-----
MIIC9zCCAd+gAwIBAgIRAP4YLqSxLm9xey/k41vmu+cwDQYJKoZIhvcNAQEFBQAw
(....)
-----END CERTIFICATE-----
3. The SSL certificate for nxhtd
The nxhtd program is the NoMachine Apache-based web server included in any of the NoMachine server installations (except NoMachine free) and necessary for accepting connections by the web. In case of Enterprise Terminal Server + Enterprise Terminal Server Nodes it's provided by the Enterprise Terminal Server and it's not installed on the remote nodes.
Installation comes with a self-signed a SSL Certificate File and SSL Certificate Key file intended to be just a sample. They are respectively, for default installation path:
Linux
/usr/NX/etc/keys/host/ht_host_rsa_key.crt
/usr/NX/etc/keys/host/ht_host_rsa_key
macOS
/Applications/NoMachine.app/Contents/Frameworks/etc/keys/host/ht_host_rsa_key.crt
/Applications/NoMachine.app/Contents/Frameworks/etc/keys/host/ht_host_rsa_key
Windows
%PROGRAMFILES%\NoMachine\etc\ht_host_rsa_key.crt
%PROGRAMFILES%\NoMachine\etc\keys\host\ht_host_rsa_key
Administrators have to replace the sample SSL Certificate File and Key File with their own certificate self-signed or acquired from a CA.
How to generate a new (self-signed) certificate and apply it
The general format of the command to generate a new certificate and private key for nxhtd is:
installation directory/bin/nxkeygen -k privatekey -c certificate [-n length]
Let's assume to create new self-signed certificates named 'new_ht_host_rsa_key' and 'new_ht_host_rsa_key.crt'.
On Linux
STEP 1 - Generate the certificate
Execute from a command line in a terminal:
$ LD_LIBRARY_PATH=/usr/NX/lib/ /usr/NX/bin/nxkeygen -k new_ht_host_rsa_key -c new_ht_host_rsa_key.crt
STEP 2 - Edit the nxhtd configuration file
Open: /usr/NX/etc/web.cfg
and set:
SSLCertificateFile "/usr/NX/etc/keys/host/new_ht_host_rsa_key.crt"
SSLCertificateKeyFile "/usr/NX/etc/keys/host/new_ht_host_rsa_key"
STEP 3 - Update certificate permissions
Move to /usr/NX/etc/keys/host/ and execute:
$ chown nxhtd:nxhtd new_ht_host_rsa_key
$ chown nxhtd:nxhtd new_ht_host_rsa_key.crt
$ chmod 600 new_ht_host_rsa_key
$ chmod 644 new_ht_host_rsa_key.crt
STEP 4 - Restart nxhtd
You can restart nxhtd from the NoMachine Server preferences UI or by command line:
$ sudo /etc/NX/nxserver --restart nxhtd
On macOS
STEP 1 - Generate the certificate
Execute in a terminal:
$ LD_LIBRARY_PATH=/Applications/NoMachine.app/Contents/Frameworks/lib/ /Applications/NoMachine.app/Contents/Frameworks/bin/nxkeygen -k new_ht_host_rsa_key -c new_ht_host_rsa_key.crt
STEP 2 - Edit the nxhtd configuration file
Open: /Applications/NoMachine.app/Contents/Frameworks/etc/web.cfg
and set:
SSLCertificateFile "/Applications/NoMachine.app/Contents/Frameworks/etc/keys/host/new_ht_host_rsa_key.crt"
SSLCertificateKeyFile "/Applications/NoMachine.app/Contents/Frameworks/etc/keys/host/new_ht_host_rsa_key"
STEP 3 - Update certificate permissions
Move to /usr/NX/etc/keys/host/ and execute:
$ chown nxhtd:nxhtd new_ht_host_rsa_key
$ chown nxhtd:nxhtd new_ht_host_rsa_key.crt
$ chmod 600 new_ht_host_rsa_key
$ chmod 644 new_ht_host_rsa_key.crt
STEP 4 - Restart nxhtd
You can restart nxhtd from the NoMachine Server preferences UI or by command line:
/etc/NX/nxserver --restart nxhtd
On Windows
STEP 1 - Generate the certificate
Execute in a CMD console launched as administrator:
> %PROGRAMFILES%\NoMachine\bin\nxkeygen -k new_ht_host_rsa_key -c new_ht_host_rsa_key.crt
STEP 2 - Edit the nxhtd configuration file
Open: %PROGRAMFILES%\NoMachine\etc\web.cfg
and set:
SSLCertificateFile "%PROGRAMFILES%\NoMachine\etc\keys\host\new_ht_host_rsa_key.crt"
SSLCertificateKeyFile "%PROGRAMFILES%\NoMachine\etc\keys\host\new_ht_host_rsa_key"
STEP 3 - Restart nxhtd
You can restart nxhtd from the NoMachine Server preferences UI or by command line:
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --restart nxhtd
4. The RSA key pair for the Enterprise Terminal Server Nodes
NoMachine Enterprise Terminal Server authenticates on the Enterprise Terminal Server Node with a RSA key pair. This RSA key pair is generated during the installation and its server specific. This means that if the node is added to a different server, also the RSA key pair will be different.
This key pair is made of:
/usr/NX/etc/keys/node.localhost.id_rsa
/usr/NX/etc/keys/node.localhost.id_rsa.pub
When adding the node to the server (by means of 'nxserver --nodeadd' command), the public part of the key pair is automatically added to the remote node.
The RSA key is deleted from the node when the node is removed from the list (with the 'nxserver --nodedel' command).
The 'nxserver --nodeedit NODENAME:PORT' command will add the new key (if set on the main server host) on the node, but it will not remove the old key.
To adopt a custom key pair for server-node authentication, follow all steps below. If not otherwise specified, commands are intended to be run on the Enterprise Terminal Server host.
STEP 1- Make a backup of the original RSA keys on the server machine in /usr/NX/etc/keys.
STEP 2- Generate a new RSA key pair and name the keys as node.localhost.id_rsa and node.localhost.id_rsa.pub (i.e. the new keys must have the same name of the original ones):
$ LD_LIBRARY_PATH=/usr/NX/lib/ /usr/NX/bin/nxkeygen -k /usr/NX/etc/keys/node.localhost.id_rsa -p /usr/NX/etc/keys/node.localhost.id_rsa.pub -t rsa
Then ensure that proper permissions and ownership are set:
$ chmod 600 /usr/NX/etc/keys/node.localhost.id_rsa
$ chown nx:root /usr/NX/etc/keys/node.localhost.id_rsa
$ chmod 644 /usr/NX/etc/keys/node.localhost.id_rsa.pub
$ chown nx:root /usr/NX/etc/keys/node.localhost.id_rsa.pub
STEP 3- Stop the server to prevent users from starting new sessions while replacing the server public key on the nodes. This will not terminate running sessions:
$ sudo /etc/NX/nxserver --stop
STEP 4- Propagate the new RSA sever public key on the node by running:
$ sudo /etc/NX/nxserver --nodeedit NODENAME:PORT
where NODENAME:PORT is the name of the remote node as it appears in the output of the 'nxserver --nodelist' command.
The 'nxserver --nodeedit' command will not remove the old key on the node. To remove it, delete the node:
$ sudo /etc/NX/nxserver --nodedel NODENAME:PORT
and re-add it so that the new key will be automatically added:
$ sudo /etc/NX/nxserver --nodeadd NODENAME
As an alternative, it's possible to execute a manual procedure to remove the old RSA public key(*) and add the new one (**) on the remote Enterprise Terminal Server Node.
STEP 5- Only if you have two NoMachine Enterprise Terminal Server Cluster configured in a failover cluster, update the cluster configuration to synchronize the new RSA key pair. Run on the primary or on the secondary server the following command:
$ sudo /etc/NX/nxserver --clusterupdate
(*) How to manually remove the old server RSA key from the node
Removing the old server RSA keys by hand is an alternative to deleting and re-adding the node when replacing the default server-node RSA key pair.
In a particular case, i.e. if the server is unable to connect to the node while executing 'nxserver --nodedel', it's necessary to adopt this manual procedure as well. That's because the node is removed from the NoMachine db but the server key is left on the node host.
To remove the old server public key manually:
1) On the server host read the current server RSA key that is going to be replaced:
$ cat /usr/NX/etc/keys/node.localhost.id_rsa.pub
2) On each of the node hosts remove the line containing the current server public key from the following files:
nx_home_directory/.nx/config/authorized.crt for server-node connections by NX protocol and
nx_home_directory/.ssh/authorized_keys2 for server-node connections by SSH protocol.
(**) How to add the new RSA public key (node.localhost.id_rsa.pub) on the remote node
To add a RSA public key on node, you can run the following command on the node host:
$ sudo /etc/NX/nxserver --keyadd public_key_file
where public_key_file is path to the new node.localhost.id_rsa.pub key.
This will add the key to the authorized.crt file if server-node protocol is NX or to the authorized keys file if server-node protocol is SSH.
Alternatively, the RSA server public key can be manually added to the proper files:
nx_home_directory/.nx/config/authorized.crt if server-node protocol is NX and
nx_home_directory/.ssh/authorized_keys2 if server-node protocol is SSH
'authorized_keys2' is the standard name used in the SSHD configuration, replace it with the appropriate name if your SSHD has custom settings.
5. The RSA Key Pair and the SSL certificate for the Failover Cluster
The failover cluster uses (i) a SSH key pair to authenticate each other the primary and secondary server and (ii) a SSL certificate on the shared IP to avoid users having to accept again the server host fingerprint when the failover occurs.
This applies to Enterprise Cloud Server Cluster servers and to Enterprise Terminal Server Cluster servers.
(i) How to generate and use a new SSH key pair for the primary-secondary server authentication
You can generate a new SSH key pair on the primary server host. Name the new keys as the original ones. The general form of the command is:
installation directory/bin/nxkeygen -k installation directory/etc/keys/cluster.id_rsa -p installation directory/etc/keys/cluster.id_rsa.pub -t rsa
On Linux:
$ LD_LIBRARY_PATH=/usr/NX/lib/ /usr/NX/bin/nxkeygen -k /usr/NX/etc/keys/cluster.id_rsa -p /usr/NX/etc/keys/cluster.id_rsa.pub -t rsa
On macOS:
$ LD_LIBRARY_PATH=/Applications/NoMachine.app/Contents/Frameworks/lib/ /Applications/NoMachine.app/Contents/Frameworks/bin/nxkeygen -k /Applications/NoMachine.app/Contents/Frameworks/etc/keys/cluster.id_rsa -p /Applications/NoMachine.app/Contents/Frameworks/etc/keys/cluster.id_rsa.pub -t rsa
On Windows:
> %PROGRAMFILES%\NoMachine\bin\nxkeygen -k %PROGRAMFILES%\NoMachine\etc\keys\cluster.id_rsa -p %PROGRAMFILES%\NoMachine\etc\keys\cluster.id_rsa.pub -t rsa
Then ensure that the new keys have proper permissions and ownership. For example on Linux:
chmod 600 /usr/NX/etc/keys/cluster.id_rsa
chown nx:root /usr/NX/etc/keys/cluster.id_rsa
chmod 644 /usr/NX/etc/keys/cluster.id_rsa.pub
chown nx:root /usr/NX/etc/keys/cluster.id_rsa.pub
How to use the new key-pair
Propagate the new key to the secondary server by running on the primary server the following command.
On Linux and macOS:
$ sudo /etc/NX/nxserver --clusterupdate
On Windows:
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --clusterupdate
(ii) How to generate and use a new SSL certificate and private key on cluster shared IP
The SSL certificate used for connections by NX protocol when the failover cluster is set-up is made of:
<installation directory>/etc/keys/host/nx_cluster_rsa_key
<installation directory>/etc/keys/host/nx_cluster_rsa_key.crt
To generate a new certificate and key, the general format of the command is:
installation directorybin/nxkeygen -k privatekey -c certificate [-n length]
On Linux:
$ LD_LIBRARY_PATH=/usr/NX/lib/ /usr/NX/bin/nxkeygen -k nx_cluster_rsa_key -c nx_cluster_rsa_key.crt -n 4096
On macOS:
$ LD_LIBRARY_PATH=/Applications/NoMachine.app/Contents/Frameworks/lib/ /Applications/NoMachine.app/Contents/Frameworks/bin/nxkeygen -k nx_cluster_rsa_key -c nx_cluster_rsa_key.crt -n 4096
On Windows:
> %PROGRAMFILES%\NoMachine\bin\nxkeygen -k nx_cluster_rsa_key -c nx_cluster_rsa_key.crt -n 4096
Then ensure that the new keys have proper permissions and ownership, as the original ones. On Linux they should look like:
-rw------- 1 nx root 1675 2013-11-18 12:18 nx_cluster_rsa_key
-rw-r--r-- 1 nx root 1090 2013-11-18 12:18 nx_cluster_rsa_key.crt
and on macOS:
-rw------- 1 nx wheel 1679 Apr 8 16:21 nx_cluster_rsa_key
-rw-r--r-- 1 nx wheel 1090 Apr 8 16:21 nx_cluster_rsa_key.crt
How to use the new certificate
Propagate the new certificate to the secondary server by running on the primary server the following command.
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --clusterupdate
6. The RSA key pair for the Cloud Server's Nodes
A node can be added to the cloud server with direct connection (from cloud server to the node) or with inverse connection (from node to cloud server).
Authentication between cloud server and nodes is always made with a RSA key pair. This RSA key pair is generated during the installation and it's node and server specific.
The key pair is made of:
installation directory/etc/keys/node.localhost.id_rsa
installation directory/etc/keys/node.localhost.id_rsa.pub
When using direct connection, the public part of the cloud server's key has to be added to the node.
When using inverse connection, the public part of the node's key has to be added to the cloud server.
In case of two Enterprise Cloud Server Cluster, is then necessary to synchronize the cluster.
To adopt a custom key pair for the authentication, follow steps below:
- Create the new RSA key pair
- Add the cloud server public key to the node
or
- Add the node public key to the cloud server
- Finally, synchronize the cluster when applicable
Create the new RSA key pair
STEP 1- Make a backup of the original RSA keys in installation directory/etc/keys.
STEP 2- Generate a RSA key pair and name keys as node.localhost.id_rsa and node.localhost.id_rsa.
In case of direct connection, execute the following command on the Cloud Server host.
In case of inverse connection, execute the following command on the node.
On Linux:
$ LD_LIBRARY_PATH=/usr/NX/lib/ /usr/NX/bin/nxkeygen -k /usr/NX/etc/keys/node.localhost.id_rsa -p /usr/NX/etc/keys/node.localhost.id_rsa.pub -t rsa
On macOS:
$ LD_LIBRARY_PATH=/Applications/NoMachine.app/Contents/Frameworks/lib/ /Applications/NoMachine.app/Contents/Frameworks/bin/nxkeygen -k /Applications/NoMachine.app/Contents/Frameworks/etc/keys/node.localhost.id_rsa -p /Applications/NoMachine.app/Contents/Frameworks/etc/keys/node.localhost.id_rsa.pub -t rsa
On Windows:
> %PROGRAMFILES%\NoMachine\bin\nxkeygen -k %PROGRAMFILES%\NoMachine\etc\keys\node.localhost.id_rsa -p %PROGRAMFILES%\NoMachine\etc\keys\node.localhost.id_rsa.pub -t rsa
Ensure also that the new keys have proper permissions and ownership, as the original ones.
6.1. Direct connection: add the Cloud Server key to the node
Optionally, stop the cloud server to prevent users from starting new sessions while replacing the server public key on its nodes. This will not terminate running sessions.
On Linux and macOS:
$ sudo /etc/NX/nxserver --stop
On Windows:
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --clusterupdate
To add the key to the node, execute the command on the cloud server host that is the parent of the node (if the cloud server is a sub-level server, be sure to execute instructions on its host and not on the main cloud server).
on Linux and macOS:
$ sudo /etc/NX/nxserver --nodeedit NODENAME:PORT
where NODENAME:PORT is the name of the node as it appears in the output of the 'nxserver --nodelist' command.
On Windows:
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --nodeedit NODENAME:PORT
Note that the 'nxserver --nodeedit' command will not remove the old key on the node.
To remove it, delete and re-add the node:
on Linux and macOS
$ sudo /etc/NX/nxserver --nodedel NODENAME:PORT
$ sudo /etc/NX/nxserver --nodeadd NODE_IP
On Windows:
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --nodedel NODENAME:PORT
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --nodeadd NODE_IP
As an alternative, it's possible to execute a manual procedure to remove the old RSA public key(*) and add the new one (**) on the remote node. See instructions below.
(*) How to manually remove the old server RSA key from the node
Removing the old server RSA keys by hand is an alternative to deleting and re-adding the node when replacing the default server-node RSA key pair.
In a particular case, i.e. if the server is unable to connect to the node while executing 'nxserver --nodedel', it's necessary to adopt this manual procedure as well. That's because the node is removed from the NoMachine db but the server key is left on the node host.
To remove the old server public key manually:
1) On the server host read the current server RSA key that is going to be replaced:
$ cat /usr/NX/etc/keys/node.localhost.id_rsa.pub
2) On each of the node hosts remove the line containing the current server public key from the following files:
nx_home_directory/.nx/config/authorized.crt for server-node connections by NX protocol and
nx_home_directory/.ssh/authorized_keys2 for server-node connections by SSH protocol.
(**) How to manually add the new RSA public key (node.localhost.id_rsa.pub) on the remote node
To add a RSA public key on node, you can run the following command on the node host:
$ sudo /etc/NX/nxserver --keyadd public_key_file
where public_key_file is path to the new node.localhost.id_rsa.pub key.
This will add the key to the authorized.crt file if server-node protocol is NX or to the authorized keys file if server-node protocol is SSH.
Alternatively, content of the RSA server public key can be manually appended to the proper files:
nx_home_directory/.nx/config/authorized.crt if server-node protocol is NX and
nx_home_directory/.ssh/authorized_keys2 if server-node protocol is SSH
'authorized_keys2' is the standard name used in the SSHD configuration, replace it with the appropriate name if your SSHD has custom settings.
6.2. Inverse connection: add the node key to Cloud Server
To add the public key from the node to the cloud server:
Step 1 - Get /usr/NX/etc/keys/node.localhost.id_rsa.pub from node and copy it to the cloud server host.
Step 2- If node-to-server protocol is NX, execute the following command on the cloud server host.
On Linux and macOS:
$ sudo /etc/NX/nxserver --keyadd path_to_node.localhost.id_rsa.pub
On Windows:
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --keyadd path_to_node.localhost.id_rsa.pub
This will add the key to the nx_home_directory/.nx/config/authorized.crt file.
nx_home_directory is:
/var/NX/nx/ on Linux
/Library/Application\ Support/NoMachine/var/nx/ on macOS
Users\nx\ on Windows
If node-to-server protocol is SSH, execute the following command on the cloud server host.
On Linux and macOS:
$ sudo /etc/NX/nxserver --keyadd path_to_node.localhost.id_rsa.pub --protocol SSH
On Windows:
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --keyadd path_to_node.localhost.id_rsa.pub --protocol SSH
This will add the key to the authorized keys file in nx_home_directory/.ssh where nx_home_directory is:
/var/NX/nx/ on Linux
/Library/Application\ Support/NoMachine/var/nx/ on macOS
Users\nx\ on Windows
6.3. Synchronize the cluster
If you have two Enterprise Cloud Server Cluster configured in a failover cluster, update the cluster configuration to synchronize the new RSA key pair. Run on the primary or on the secondary server the following command.
On Linux and macOS:
$ sudo /etc/NX/nxserver --clusterupdate
On Windows:
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --clusterupdate
