Home
Home Blogs k4tz's blog
    • Blog
    • Clinic
    • Contact
    • Download
    • Video
    • Login

Poll

Favourite console text editor in Ubuntu:

LXer -- Linux and Open Source News

  • Ubuntu 10.10 beta – an insider’s view
  • Equinox Introduces 2 Other Brilliant Themes, Installation Made Easy via PPA
  • First Alpha of uTorrent Server for Linux Released
  • A Linux Demo For Amnesia: The Dark Descent
  • Fedoraproject.org redesign looking really, really great
more

Linux Today

  • Editor's Note: Holiday Tech Fun
  • Mint 9: Minty fresh Linux
  • Amnesia: The Dark Descent Demo Released!
  • Android: the return of the Unix wars?
  • Songbird 1.8.0 adds support for more devices
more

Linux Insider

  • Tablet Skirmish Heats Up With Toshiba Entry
  • Samsung's Galaxy Whirls Into the Tablet Universe
  • Sony's Shocking 'Other OS' Win and Suspect Distro Popularity Trends
  • 2 Smart Backup Apps Show You the Way to Go Home
  • Cloud Computing Calms Open Source Warfare
more

NoMachine NX: simple setup without adding users

Submitted by k4tz on Wed, 12/03/2008 - 13:20
  • Blog
  • Ubuntu

Source: http://ubuntuforums.org/showthread.php?t=941530

After struggling with VNC for some years I finally tried out Nomachine's NX server instead. Overall it's much faster than VNC and very simple to set up. However, searching this forum and google turned up lots of conflicting instructions about how to configure things. So in the end I just waded through Nomachine's online documentation and help system. What I wanted was for the connection to a remote machine to be as secure as possible, and more usable than VNC through an ssh tunnel, without having to jump through too many configuration hoops. I'm posting what I did here in case someone else wants to give NX a try. I know there are other how tos on the forum, but most seem to include a step about adding users. This isn't strictly necessary, and so I haven't included it.

Just for information, both the server and client software were installed on Hardy, and I've used the latest version of the Nomachine packages and not the FreeNX packages. I believe FreeNX is very similar, but having never tried it I don't know if these instructions will work with that as well. So here goes:

1. Make sure openssh-server is installed on the server machine/s and that you can ssh into into those machines. See this link. Just one caveat. You must ensure that password based authentication is enabled in the /etc/ssh/sshd_config file of the server machine. Initially you should also use the standard port 22 for ssh as well.

2. Download these files from here

nxclient_3.2.0-14_i386.deb
nxnode_3.2.0-13_i386.deb
nxserver_3.2.0-16_i386.deb

3. Put the files in the home directory of the machine you want to use as the server, open a terminal, and install them:

Code:
sudo dpkg -i *.deb

note: make sure that these are the only .deb packages in your home directory when you do this.

4. Repeat the above on the client machine - on the client you only need the nxclient package and not the nxserver and nxnode packages

5. At this stage it's worth testing that everything works 'as is'. You may have to do a 'killall gnome-panel' before the NX entry appears in the menu, but once it has you'll find it under applications/internet. Open the NX connection wizard and follow along. You should be able to log in as a normal user with the user name and password that you normally log into the system with. If all goes well a session should open on your desktop displaying the server machine's desktop.

6. If all went well you will now want to change the default ssh keys that the NX server uses. When you first install the nx packages they ship with default keys that are the same for everyone. Potentially this means that anyone with the nxclient package installed could authenticate against your server. Not good! However, changing these keys is simple. Just log into the server (or ssh to the server) and do the following:

Code:
sudo su
/usr/NX/scripts/setup/nxserver --keygen
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

Then copy the default.id_dsa.pub file to the client. I did this using scp from the client machine, e.g.

Code:
scp user@server:/usr/NX/share/keys/default.id_dsa.key .

But you could just as easily copy it to a usb flash drive and transfer it to the client. Once you've saved it to the client machine's home directory you should rename the key from default (I use my user name) and copy it to the /usr/NX/share/keys/ directory:

Code:
sudo cp default.id_dsa.key /usr/NX/share/keys/user.id_dsa.key

Now test that you can connect to the nx user account on the server with this key:

Code:
ssh -i /usr/NX/share/keys/user.id_dsa.key nx@server

You shouldn't be prompted for a password. If you can connect as the nx user just type quit to exit. Then launch the nx client from the menu, hit configure, and then the key button on the general tab. Delete the exiting key and press the import button. Import the key that you've just saved in the /usr/NX/share/keys directory. Save everything and then try connecting with the client.

Optional steps

7. If all went well you can now change the default ssh port to a non-standard one (say 2222 for this example). Go back to the server machine (or shh to it) and edit three files to make the changes.

First edit the /usr/NX/etc/server.cfg file:

Code:
sudo gedit /usr/NX/etc/server.cfg

Look for these entries:

#SSHDPort = "22"
#SSHDAuthPort = "22"

Uncomment and change 22 to 2222. Save and close.

Then edit /usr/NX/etc/node.cfg:

Code:
sudo gedit /usr/NX/etc/node.cfg

Look for this entry:

#SSHDPort = "22"

And again uncomment and change the port number. Save and close.

Finally edit /etc/ssh/sshd_config

Code:
sudo gedit /etc/ssh/sshd_config

Look for this entry:

Port 22

And again change the port, save and close.

Finally, restart ssh:

Code:
sudo /etc/init.d/ssh restart

On the client machine you should then launch the nx client, press the configure button, and enter the new port in the general tab.

That's it. You should now be able to connect to the nxserver on a non-standard port with a custom ssh key.

8. For added security you might also want to go back to the server machine and edit the /usr/NX/etc/server.cfg file again. Find this line:

#EnableUnencryptedSession = "1"

Uncomment it and change the "1" to a "0"

This will force nx to use ssl encryption at all times.

That's basically it. The only problem I have with nx so far is not being able to disable password based authentication in my sshd_config. There is a work around which involves adding system users to the nx server and then using the nx database rather than ssh to authenticate. However, I haven't tried this, so I'm not able to comment on how well it works, What I've done instead is limit the number of users who can ssh into the server machine (nx must be a listed user), and restricted access in my firewall to only allow certain machines through.

Hope this helps someone.

  • k4tz's blog
  • Add new comment

Recent blog posts

  • How to install PHP-GTK in Ubuntu 10.04 Lucid Lynx
  • Download Linux Mint 9 "Xfce"
  • ISO Booting with Grub 2 in Ubuntu
  • Howto Fix Rhythmbox Iphone + Ipod Sync Issues in Ubuntu
  • How to install Ubuntu 10.04 on Thinkpad x201
  • Fix for Audio Problem in Dell Studio 1450 in Ubuntu 10.04 (lucid lynx)
  • Howto optimize Flash in Firefox on Ubuntu
  • HP Laserjet P1006 Printer not Working on Ubuntu
  • How to get video recording working with Acer Crystal Eye Webcam on Ubuntu
  • Reset your Windows password and edit the Windows Registry from Ubuntu
more

Linux World

  • Net Neutrality: what does the Google Verizon proposal mean for GNU Linux?
  • Why can't free software lead to hardware innovation?
Archive Syndicate content

Recent comments

  • Re
    34 weeks 4 days ago
  • Re
    34 weeks 4 days ago
  • Re
    35 weeks 4 days ago
  • Re
    36 weeks 22 hours ago
  • Re
    36 weeks 5 days ago
  • Re
    36 weeks 5 days ago
  • Re
    37 weeks 2 hours ago
  • iwl3945
    38 weeks 4 days ago
  • HomeBank
    50 weeks 5 days ago
  • KMyMoney and direct connect to banks
    1 year 2 weeks ago
All contents copyright © 2008, Dhuha Net. All rights reserved
Ubuntudoctor® is a member of the Dhuha Network. Privacy Policy
RoopleTheme