User Tools

Site Tools


howto:nx

NX - Compressed X11 over SSH by NoMachine

NX is as safe as SSH and faster than VNC. You can have your EEE's desktop appear on another computer, or use your EEE to control another Linux machine. Because of the way NX uses cache and compression this is feasible even across the internet, even from public WiFi, with great security and privacy.

Installing NX

What you need:

  • A working SSH installation
  • The .DEB Debian Client, Node and Server packages from NoMachine

Outline

Once you can log into your machine by typing

ssh localhost

you can start installing NX.

When you use the NX Client, instead of you being given access to your computer as above, another user “nx” is sent to the SSH server. “nx” is a system user and doesn't have a login shell the same way you do. If “nx” logs in, a script is run that requests a desktop session, then tells your computer which user wants to log into it. Your username (“user”) and password are sent through the encrypted tunnel and your desktop appears if all went right.

  • NX Client connects to the SSH server on the remote computer
  • User “nx” tries to authenticate via SSH public key
  • NX Server asks for the user and password of the person logging in
  • NX Server checks the details against the local accounts, or the NX database
  • NX Server runs the user's desktop and sends the information to the client
  • NX Client makes an X window containing the remote desktop

Nothing appears on the display of the remote PC, it is all done in the background.

Installing

Start a console (CTRL-ALT-T) I'm going to recommend using the root account because … I'm dangerous and foolhardy. It isn't clever or big.

sudo bash

cd to the directory where you downloaded the packages (cd /home/user/My\ Documents) or (cd /home/user/Desktop)

dpkg -i nxclient-VERSION.deb

and copy the code to change the permissions on your CUPS file, paste it to the command prompt and press return.

dpkg -i nxnode-VERSION.deb
dpkg -i nxserver-VERSION.deb

Once that is done there is a very important step that should be taken. NX provides an SSH key for user “nx” with the package, but we don't want that key. We want a unique key to improve security. To make this you should run (as root)

/usr/NX/bin/nxserver --keygen

The location of the key is displayed on the screen.

cp /usr/NX/share/keys/default.id_dsa.key /home/user/.ssh/NX.Server.key
chmod 400 /home/user/.ssh/NX.Server.key

This key is in reality a key to your machine now, take care of it. If you need to log in to your machine you will need this key on the computer you are using so put it on an SD card.

Set up your user

There is another method of doing this step which someone else will have to edit in.

You can edit the NX configuration file to allow NX to authenticate users with its database once the correct public key has been used to log “nx” in. As root:

nano /usr/NX/etc/server.cfg

Look for the options “EnableUserDB” and “EnablePasswordDB”, set them to EnableUserDB = “1” and EnablePasswordDB = “1”.

/usr/NX/bin/nxserver restart

Set up the users that have access to NX:

/usr/NX/bin/nxserver --adduser <username>

When prompted you can use any password you want, but for simplicity you can make it the same as the one that you used for the username. Then

/usr/NX/bin/nxserver --userenable user

This should be the end of the installation. If all went well.

Running NX

There are several NX clients available, one comes with the package.

You can start your NX Client either from the GUI by adding it to your Easy desktop or from the K menu. If you haven't done this you can type

/usr/NX/bin/nxclient &

and start entering the information needed for the computer you want to log in to.

NX Client config

You will need:

  • The name/IP address of the computer you want to connect to
  • A valid username/password for NX on that machine
  • The SSH key of the “nx” user if you made a unique key

Give the session a name (EEE will do). You can see where the username/password goes, the remote computer address goes in the “Host” box which appears when you click “Configure …”. If you're reading this, then leave the port as “22”. If you're testing your install you can enter “localhost” or “127.0.0.1” in the “Host” field.

To enter the “nx” SSH key, click “Configure …” and “Key …”. Either use the “Import” button and find the NX.Server.key file you copied earlier or paste a key into the box. This key will be saved if you save the configuration.

If you want to run a full desktop session you can start now, but you can choose to run just a program (Firefox for example) by changing the Desktop settings to “Unix” “Custom” and enter the name of the program.

Errors

Too many to list. For help you can go to Google and enter the error that comes up when you click “Detail …” or you can search the NoMachine Knowledge Base.

If you need to check that the user is enabled for NX login on the remote computer you can use (as root)

/usr/NX/bin/nxserver --usercheck <username>
howto/nx.txt · Last modified: 2008/07/07 12:31 by preditor