How to access your Ubuntu 14.04 Desktop securely over the network with FreeNX

FreeNX offers a way to securely access your desktop remotely over a local network or the Internet. FreeNX is the OpenSource implementation of the NX protocol, originally developed by NoMachine. The NX protocol is very efficient and allows X-Desktop-Connections over slow network uplinks. The connection is secured with SSL / TLS. In this tutorial we are going to check how to install and configure FreeNX on Ubunru 14.04 (Trusty Tahr).

 

Installation

Installing FreeNX Server.

The FreeNX packages is not availabble in the official ubuntu repositories, you will have to add FreeNX PPA:

sudo apt-add-repository ppa:freenx-team/trusty

For the older versions:

sudo apt-add-repository ppa:freenx-team

All it takes is a confirmation to add it, hit Enter and you are done.



After being done with it you can proceed with the installation:

sudo apt-get upgrade

This will update your repositoties.

sudo apt-get install freenx-server

With the above commands you should be able to install FreeNX on your system.

Installing the NX Client

The actual client is not available on the repositories. You will need to install the client from the NoMachine's website. Download and install the client and you will be done. You will be able to go through the setup , and you will be done.

 

Configuring FreeNX

Configuring SSH

The default port used by FreeNX is port 22 for SSH. There are chances that your port 22 might be blocked by your ISP due to security reasons, so basically we will have to change the default port for SSH connections.

sudo nano /etc/ssh/sshd_config

Find Port 22 and replace with Port 8888

After doing the above all you need to do is restart your SSHD:

sudo /etc/init.d/ssh restart

Generally FreeNX detect's SSHD port, but if it doesn't you may try this:

sudo nan /etc/nxserver/node.conf

Find #SSHD_PORT=22 and replace with SSHD_PORT=8888

Make sure you uncommment the port number. This is how you can change the port number for FreeNX.

Starting/Stoping FreeNX

FreeNX is not a service so you will have to run it manualy:

sudo /etc/init.d/freenx-server stop/start

Creating Custom SSH Keys

Using the default ssh keys for authentication will be pure stupidity. So, lets start with creating your own To crete your own custom keys use:

sudo dpkg-reconfigure freenx-server





Hit Enter and the next you will se is a option for using the key type for FreeNX:



Select the option "Create new custom keys" then you will be prompted for the type of authentication, mke sure you use SSH.



Now we need to copy the key to the $HOME folder:

sudo cp /var/lib/nxserver/home/.ssh/client.id_dsa.key ~/





Now you can copy your client.id_dsa.key to your relevant USB drive or any place you want to keep it, make sure it is safe and is only accessible by you. The file will be used by your client machine to connect with your server system. After creating your file you should be able to use it next time with your nx client.

Share this page:

15 Comment(s)

Add comment

Comments

From: JohnP

Used FreeNX for a few years, but it didn't work on 14.04 last year when I needed it.  The good news is that x2go, also based on NX/ssh, was ready and worked. Plus x2go doesn't need any manual tweaking on the server side to work.

http://wiki.x2go.org/doku.php/doc:installation:x2goserver has perfect instructions for Ubuntu. Since it is ssh-based for the tunnel, we can setup ssh keys and not be bothered with authentication at connect time.

x2go/FreeNX is about 2x-3x more network efficient than either RDP or VNC, plus is uses ssh, so security isn't the same concern. Getting audio and file sharing between the client/server under x2go is trivial.

Downsides do exist. No viable Android NX client exists, but there are great, stable, clients for Windows, OSX, and Linux. Like all remote desktops, video isn't great, but audio does work well. Also, NX is built on some older versions of X11, so that might be a real concern.

My primary desktop is actually a virtual machine, running in a private cloud, accessed through x2go from anywhere in the world. It is THAT GOOD.

From: Jean-Francois Messier

I was having issues in the past where a Unity-based Ubuntu (or Gnome 3) desktop would display, but with no icon bar, or no display at all. Will this install solve such problem, or do I have to install a different desktop than Unity or Gnome 3 ? 

From: mikael lonnqvist

Question: 

"The default port used by FreeNX is port 22 for SSH. There are chances that your port 22 might be blocked by your ISP due to security reasons, so basically we will have to change the default port for SSH" connections"

If i replace Port 22 for Port 8888 - does this not affect sshd globally?

What if i still want to be able to ssh to my machine on standard port 22 as usual, 

but would like to additionally fire up freenx and connect to it on port 8888 ?

BR/Mikael

From: andy

 You can have sshd listen on multiple ports.  The method i'm using (in RHEL6) is:

As root:

ln -s /usr/sbin/sshd /usr/sbin/sshd_2

create /etc/ssh/sshd_2_configPort <some_other_port_number>AddressFamily inetListenAddress xxx.xxx.xxx.xxxProtocol 2SyslogFacility AUTHPRIVSubsystem sftp /usr/libexec/openssh/sftp-serverPermitRootLogin noUsePAM yesAllowTcpForwarding yesAllowGroups <allowed_groups>

 

cp /etc/init.d/sshd{,_2}Update you're new /etc/init.d/sshd_2 file, updating sshd with sshd_2

Then add sshd_2 to chkconfig.

I haven't tried it on Debian based distros, but I would assume the config files will be the same. 

 

From: Jens G.

sudo apt-get upgrade

Sorry, but this is wrong, this will not update your repositories but will update pending (security) updates and/or upgrade your system. What you meant is "update" not "upgrade"

From: Etescartz

I also would like to recommend X2GO server. Being a long time Remote user , I've used SSH,  RDP , Nomachine, Tunneled VNC over SSH , but I was really impressed by X2GO since it requires minimal configuration and it's light on resources and makes me feel like I'm actually in front of the computer.

   The X2GO feature I appreciate the most is that when I connect to the remote linux machine , I get a secondary graphical session generated by the X2GO server. This completely independent from any local session on that machine. (This is something  Nomachine did in it's older versions , but I can't seem to enable now in the free verion )

From: Chris Noffsinger

x2go is a much easier implementation of freenx

From: mark bohr

We obviously have x2go developers writing here. FreeNx died years ago,  and x2go wont be far off. both have done nothing except cause incompatibilities with the original NX which I am glad to see is still going strong. They have moved on, so should x2go if it wants to keep up.

From: tracyanne

I just use ssh direct rather than the extra overhead of something like NX or any other full desktop over the network application.

ssh -XC [email protected] works for me. If I need to use a GUI X over ssh is all I need. I just type the required GUI application into the terminal and interact with it.

From: DJ.

I use ThinLinc from Cendio AB, Sweden. It's not 100% opensource (about 99% is though) but it's free to use if you stay below 10 x concurrent connections. The installation is very trivial. In addition to the dedicated clients (available for Linux, Windows, Mac OS X) it has a HTML 5 interface too (can be added as install option) so you can use any HTML 5 compliant browser to remotely access your Linux desktop. Performance is tip top. So if running partially commercial software (as I said: most components are open source; not all though) doesn't bother you too much, give ThinLinc a try? And no, I am not affiliated with them in any way. I'm just a happy user.

From: Roland

Mark Bohr, you should be a little more specific if you don't want your post to appear to trollish! "We obviously have x2go developers writing here. FreeNx died years ago,  and x2go wont be far off. "

Why?  There is still nothing that comes even close to the performance of NX3.  NX4 is not open, so I doubt that it will ever receive the uptake NX3 has.  X2Go will continue to be developed simply because it addresses a problem that is very real and it does so really well.So if you have real criticism, please post it, but tell us what it is.  Your comment is really meaningless otherwise.

"both have done nothing except cause incompatibilities with the original NX which I am glad to see is still going strong. They have moved on, so should x2go if it wants to keep up."So are you an NX4 developer or what qualifies you to pronouce this verdict?  NX4 is frustrating, difficult to use and I have not bothered with it since I tried it a while ago.  It clearly does not fit the bill for people that want lightweight fast remote GUI access.

From: Giacomo

I was an happy user of FreeNX.Now I moved to x2go, but I've a lot of trouble.I tryed first on Ubuntu 14.04 (Gnome) with no luck (it shows background only, with no menu, tabs...).Then I moved to Lubuntu 14.04 but Firefox continuosly hangs.Could you please suggest the optimal enviroment for x2go (I need also audio)?

Thanks!

From: sven86

 I tried you steps above, but the file /var/lib/nxserver/home/.ssh/client.id_dsa.key didn't exist. What's going on?

From: Edwin

Dear all,

I am having issues getting my NXserver to run. When I start it I obtain:

Not starting freenx-server, it's already started.

I stop it and get:

NX> 500 Error: No running sessions found.

 

I already followed the instructions above which include created keys and copying the files into my client. However when I run my client I get and error 107. 

Does anyone have any suggestions?

 

Thanks

From: swarna sekhar dhar

hi i got an issue while i execute apt-get install freenx-server :

it gives error as follow :

 

 apt-get install freenx-serverReading package lists... DoneBuilding dependency treeReading state information... DoneE: Unable to locate package freenx-server

 

how can i resolve it