Manual procedure for adding nodes to NoMachine Cloud Server using Public Key Authentication
To add a node to the Cloud Server, administrator credentials for the node are typically required to enable the Cloud Server to add its public key to the node.
If the administrators of the Cloud Server and of the node are different and cannot share credentials, it's possible to adopt a manual procedure to propagate the public key from the server to the node and then proceed to add the node.
Steps for manually adding the Cloud Server’s Public Key to the node
Step 1 - Copy the public key from the Cloud Server to the node.
Locate the Cloud Server’s public key, depending on the operating system.
On Linux: /usr/NX/etc/keys/node.localhost.id_rsa.pub
on macOS: /Applications/NoMachine.app/Contents/Frameworks/etc/keys/node.localhost.id_rsa.pub
on Windows: %PROGRAMFILES%\NoMachine\etc\keys\node.localhost.id_rsa.pub
Step 2 - Add the Public Key to the node
On the node, open a terminal and run the following command to add the transferred public key:
sudo /etc/NX/nxserver --keyadd path_to_node.localhost.id_rsa.pub
Replace path_to_node.localhost.id_rsa.pub with the path where you saved the public key on the node.
Step 3 - Finally move to the Cloud Server and add the node
Run in a terminal on the Cloud Server:
sudo /etc/NX/nxserver --nodeadd IP_of_node --node-name name_of_node
Replace IP_of_node with the IP or hostname of the node and name_of_node with the name of the node, for example testdrive.
A practical example, adding a node from a Linux Cloud Server
1) If you have admin access to the node, to copy the public key, run the following command on the Cloud Server to transfer the public key to the node:
sudo scp /usr/NX/etc/keys/node.localhost.id_rsa.pub user@IP_of_Node:/tmp
Replace user with the name of a valid user on the node and IP_of_Node with the IP address of the node.
2) Move to the node. To add the public key on the node, after having transferred it, run in a terminal on the node:
sudo /etc/NX/nxserver --keyadd /home/user/node.localhost.id_rsa.pub
3) Finally, move to the Cloud Server. To add the node to the Cloud Server, run the following command in a terminal on the Cloud Server:
sudo /etc/NX/nxserver --nodeadd IP_of_node --node-name name_of_node
