April 24, 2019

Graphical Remote Control Desktops for Linux, part 3

Final Steps For NXServer Setup

  • November 6, 2008
  • By A. Lizard
First you may wish to read part 1 and part 2.

Create NX Server keys:

# /usr/NX/scripts/setup/nxserver -keygen

The critical output from your viewpoint is:

NX> 704 Keys updated. NX clients should now use key:
NX> 704 /usr/NX/share/keys/default.id_dsa.key
NX> 704 to get connected to this NX server.

Now you should copy the encryption key to a more convenient location, and give it correct permissions:

# cp /usr/NX/share/keys/default.id_dsa.key /home/username/path-to-somewhere-convenient/default.id_dsa.key
# chown nx:root /usr/NX/home/nx/.ssh/authorized_keys2
# chmod 0644 /usr/NX/home/nx/.ssh/authorized_keys2
# chown nx:root /usr/NX/home/nx/.ssh/default.id_dsa.pub
# chmod 0644 /usr/NX/home/nx/.ssh/default.id_dsa.pub

Open /usr/NX/etc/server.cfg as root with a text editor and make the following changes:

# ServerName = "localhost.localdomain"
ServerName = "localhost"

#SSHDPort = "22"
SSHDPort 54322

#SSHDAuthPort = "22"
SSHDAuthPort = "54322"

The following configuration allows a local and remote user to share a desktop, helpful if one is a remote client user trying to work with a user on the server. Great for remote customer service, and tthere are also options that allow customizing the "shadow session" starting with "Allow session shadowing on this server" in the section just above this one and several sections of the configuration file below it.

# EnableInteractiveSessionShadowing = "1"
EnableInteractiveSessionShadowing = "1"

Note location of keys:


This is the key you will later be distributing to client machines for Nxclient.

# chown nx:root /usr/NX/home/nx/.ssh/authorized_keys2
# chmod 0644 /usr/NX/home/nx/.ssh/authorized_keys2
# chown nx:root /usr/NX/home/nx/.ssh/default.id_dsa.pub
# chmod 0644 /usr/NX/home/nx/.ssh/default.id_dsa.pub
# /usr/NX/bin/nxserver -restart
# /usr/NX/bin/nxserver --useradd username
NX> 801 User: username uses SSHD authentication.
NX> 900 Adding public key for user: username to the authorized keys file.
NX> 716 Public key added to: /home/username/.ssh/authorized_keys2.
NX> 900 Verifying public key authentication for NX user: alizard.
NX> 900 Public key authentication succeeded.
NX> 301 User: username enabled in the NX user DB.
NX> 999 Bye.

Most Popular LinuxPlanet Stories