Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old November 30th, 2005   #1
amarra
Spilled the Beans
 
Join Date: Apr 2005
Location: Galatina, LE - Italy
Beans: 14
Kubuntu 7.04 Feisty Fawn
HOWTO: Install FreeNX

HOWTO: Install FreeNX on (K)Ubuntu Breezy

This is my experience in installing the FreeNX server and the NoMachine NX Client on my Kubuntu Breezy.
I had some troubles in getting the whole thing work, so I write this little howto hoping that it may be useful for other (K)Ubuntu users


0. CONFIGURING THE RIGHT PACKAGE REPOSITORY


I used .deb packages from Seveas repository. In order to configure it for apt-get (or Synaptic) add the following line to /etc/apt/sources.list:

Code:
deb http://seveas.ubuntulinux.nl/ breezy-seveas all
In order to install the appropriate gpg key, execute the following commands (as described on the Seveas home page):

Code:
gpg --keyserver subkeys.pgp.net --recv-keys 1135D466 
gpg --export --armor 1135D466 | sudo apt-key add -


1. INSTALLING THE SERVER


Having Seveas repository configured, it is easy to install the server part of FreeNX. Simply install the freenx package:

Code:
sudo apt-get install freenx
It will also install some dependencies, notably ssh, nxagent and nxlibs. Your (K)Ubuntu will ask you if you want to use the standard NoMachine key, among some other options. I recommend to use the standard NoMachine key for standard use (or for the initial debug of the NX protocol). We will see later how to setup a custom key for higher security.
Please note that the key is used for public key authentication on the user "nx", who is used by the NX protocol to establish an SSH tunnel for the secure protocol data transport. Session authentication is (by default setup) based on PAM, allowing server users to establish a remote NX session by mean of their own credentials (username and password, as defined on the server).

It is now necessary to check some settings of the ssh subsystem, by editing the /etc/ssh/sshd_config file:

1) sshd should listen on the standard 22 port. Please check that the sshd_config contains the line "Port 22" and that it is not commented out.
2) public key authentication is turned on. Check the sshd_config so it contains the line "PubkeyAuthentication yes"
3) modify the "AuthorizedKeysFile" line in "AuthorizedKeysFile %h/.ssh/authorized_keys2" (default is "%h/.ssh/authorized_keys")
4) By default, sshd should allow every system user to access the system. If your system is configured differently, please add (or modify) the "AllowUsers nx" line to allow the nx user to access. I think you can use the "user@host" syntax for this sshd parameter to limit hosts from which users can logon via NX.

If you have made any change to the sshd_config, restart the ssh daemon with
Code:
sudo /etc/init.d/ssh restart

2. INSTALLING THE CLIENT

On the client machine, from the Seveas repository, install the nxclient package.
In my KDE, I found the "NX Client for Linux" in the "Lost+found" submenu. Launching the client for the first time brings up a connection wizard that will allow you to setup a connection to a remote NX server (in this case, the one configured above). Insert the session name (just an identifier of the server/service/host you will connect to), the server IP address and pay attention to check the "Enable SSL encryption of all traffic" option. You may set other options in the connection wizard, for example the type of remote window manager to fire up when the nx user connects (KDE, GNOME, others) and the resolution of the virtual NX session.
Please note that the connection created by the wizard make use of the standard NoMachine key. We will see later how to change the connection key to a custom one.
At the end of the wizard, the NX client logon form fires up. You can insert the username, the password and choose one of the defined sessions.
The login button will attempt the NX connection to the server as defined in the selected session. If you press the "Configure..." button, you can change ALL the parameters of the selected session (the ones defined with the connection wizard and other...).



3. (Optional) DEFINING AND USING CUSTOM KEYS

If you chose "Custom keys" when prompted during the server package, the installation creates a random authentication key for the user "nx". If you chose the standard NoMachine key, you can reconfigure the freenx package to change this setting to "Custom keys" with the following command:

Code:
sudo dpkg-reconfigure freenx
The key is stored in the client.id_dsa.key file in the .ssh subdirectory of the nx home directory (default: /var/lib/nxserver/home/.ssh/client.id_dsa.key). You have to share this key with all the client hosts you want to authorize, by copying this file on the client machine and then importing it into the NX client. The destination path is not important, but you must know it to import the key file into the NX client.
To import the key, open the NX client, select the right session and click on the "Configure" button. From the "General" tab of the configuration window, click on the "Key" button and then on the "Import" button. Then select the client.id_dsa.key you copied from the server and click on the "Save" button, "OK" button (please confirm to save the new configuration)
From now on the NX connection to the server will use the new key. Clients with the default key (or other custom keys) cannot authenticate to the server anymore.

You can return to the standard NoMachine key by reconfiguring the freenx package on the server, and by modifying the key used by the client with the same procedure described above, but clicking on the "Default" button instead of the "Import" button we used before.

If you played with NX keys and your client doesn't authenticate anymore to the server, you can start from a clean state by reconfiguring the freenx package on the server and choosing the "Remove freenx keys" and reconfiguring again choosing the "NoMachine keys" or the "Custom keys" options.


Conclusions

I apologize for my english, far from being good. However I hope that this howto can help some user that (like me) has encountered troubles in configuring this powerful remote control protocol.

As a last note, if you has other troubles and you have set up a firewall, please check firewall settings keeping in mind that only the port 22 (ssh) have to be enabled in order to establish a connection to the server.

Bye



amarra is offline   Reply With Quote
Old December 5th, 2005   #2
PokerFacePenguin
A Carafe of Ubuntu
 
Join Date: Aug 2005
Location: On the Internet / Southea
Beans: 104
Ubuntu 9.10 Karmic Koala
Send a message via Yahoo to PokerFacePenguin
Re: HOWTO: Install FreeNX on (K)Ubuntu Breezy

Very nice HOWTO.
__________________
Quad Core Q6600 2.4Ghz / 1066FSB;XFX nForce 680i LT SLI Socket 775 MBoard; GeForce 8500GT 256MB;OCZ 700W GameXstream PS;Seagate 500GB SATA HD 7200/16MB/SATA-3G;4GB Corsair TWINX PC6400 DDR2 800MHz EPP RAM
PokerFacePenguin is offline   Reply With Quote
Old December 5th, 2005   #3
Heretic09
A Carafe of Ubuntu
 
Join Date: Apr 2005
Beans: 66
Re: HOWTO: Install FreeNX on (K)Ubuntu Breezy

I get the following error when I try to apt-get freenx:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
freenx: Depends: expect but it is not installable
E: Broken packages
Heretic09 is offline   Reply With Quote
Old December 6th, 2005   #4
bloodyjoergi
First Cup of Ubuntu
 
bloodyjoergi's Avatar
 
Join Date: Oct 2005
Beans: 5
Re: HOWTO: Install FreeNX on (K)Ubuntu Breezy

i have tried the howto and it worked great... thanks...
bloodyjoergi is offline   Reply With Quote
Old December 6th, 2005   #5
sander marechal
A Carafe of Ubuntu
 
Join Date: Mar 2005
Beans: 109
Re: HOWTO: Install FreeNX on (K)Ubuntu Breezy

Great work. It worked on my first try. Does exactly what it says on the tin. Now I can provide support to my parents without biking over half an hour trough rainy weather
sander marechal is offline   Reply With Quote
Old December 15th, 2005   #6
drbmm
First Cup of Ubuntu
 
Join Date: Sep 2005
Beans: 2
Re: HOWTO: Install FreeNX

If you get errors when you run nxsetup --setup-nomachine-key related to not being able to connect-check sshd_config AllowedUsers nx, make sure sshd allows public key authenication, .etc. Check the permissions on the directory /var/lib/nxserver/home/. Make sure it has the correct permissions to allow user "nx". I spent several hours trying to get freenx going only to find the permissions on this directory were wrong. As soon as I corrected this and ran nxsetup --setup-nomachine-key the program set up the nxserver without errors.

If you need to access your linux box on your local network from windows or another linux box to run programs, .etc, freenx is a better choice than vnc. It is much faster and doesn't have the screen and mouse issues that I have run into with vnc.
drbmm is offline   Reply With Quote
Old December 18th, 2005   #7
statop
First Cup of Ubuntu
 
Join Date: Dec 2005
Beans: 1
Re: HOWTO: Install FreeNX

I am having a problem with connecting to my breezy machine running FreeNX with the Windows NoMachine client. I have no problem running the linux client within the server using localhost but when I try to connect from my windows box it just sits there and displays "Setting up the X environment". I have copied over the DSA key from the server and everything seems to be setup correctly. I can ssh into the server from the windows box fine.

Last edited by statop; December 18th, 2005 at 04:34 AM..
statop is offline   Reply With Quote
Old December 28th, 2005   #8
psypher
A Carafe of Ubuntu
 
psypher's Avatar
 
Join Date: Feb 2005
Beans: 138
Re: HOWTO: Install FreeNX

That repository does not work, I think it is now:
deb http://free.linux.hp.com/~brett/seveas/freenx/ ubuntu-seveas freenx

but I am still following the HOWTO and not sure if it works. But the old repo defenitely does not work
psypher is offline   Reply With Quote
Old December 29th, 2005   #9
Danielle
Way Too Much Ubuntu
 
Join Date: Nov 2005
Beans: 285
Re: HOWTO: Install FreeNX

here's a podcast all about FreeNX along with afew other things.
http://www.twatech.org/eps/twat050.mp3

http://twatech.org/
__________________
display email addresses like this - with spaces so they can't be harvested by bots -
addy @ wherever . com
Danielle is offline   Reply With Quote
Old January 14th, 2006   #10
duffydack
A Carafe of Ubuntu
 
Join Date: Sep 2005
Beans: 100
Re: HOWTO: Install FreeNX

I got this to work locally but after opening the port in my router that i set in /etc/nxserver/node.conf and etc/sshd/sshd_config (not 22) i can not get it to login. It gets past auth ok and then says negotiating link params, then hangs for while, then gives me some crap about couldnt establish link with proxy or some babble.. i dont have a proxy, i have setup apache with custom port just fine and enabled it on the net... Whats wrong?
i even added a range of ports that the nxclient uses (1000 + )
nadda
duffydack is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:47 AM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry