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

Poll

Favourite console text editor in Ubuntu:

Archives

July 2009
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311

LXer -- Linux and Open Source News

  • PostgreSQL 8.4 Improves Database Management, Security
  • Linux based Solar-powered networking anywhere
  • PostgreSQL 8.4 now available
  • Reserve Your Space on the Australian Stage
  • GPLv3 Celebrates Two Years, GPLv2 Still in Front
more

Linux Today

  • The Kernel Newbie Corner: Your First Loadable Kernel Module
  • Red Hat inks cloud partnership with Amazon
  • PostgreSQL 8.4
  • 10 Awesome Features of Krunner in KDE 4
  • Changing the World, One Penguin at a Time
more

Linux Insider

  • Is Dell Building an Android PDA?
  • Wikipedia and the Kidnapped Reporter: Censor or Savior?
  • The Business Case for Virtual Business, Part 2
  • Conspiracy Theories and the 'Smoking Gun'
  • What I Need to Help Sell Linux
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

  • Questions about installing Ubuntu on HP Mini 1000 netbook
  • Epson NX400 driver in Ubuntu
  • Installing Ubuntu Jaunty on HP DV2 laptop
  • How to Install latest version of Midori [Browser] on Ubuntu
  • Download PCLinuxOS 2009.2
  • Download Sabayon Linux 4.2 "GNOME"
  • Map Windows Shares Permanently on Ubuntu with GVFS
  • Ubuntu 9.04 (Jaunty) and Acer Aspire One AOD150-iBb
  • Using Linux Ubuntu on HP HDX 16t Laptop
  • Run a particular program but prevent it from accessing the Internet
more

Linux World

  • Microsoft's Secret Weapon isn't FUD, it's Inertia
  • Will Google Wave revolutionise free software collaboration?
  • Is Android the key to the GNU/Linux desktop? Really?
  • USN-785-1: ipsec-tools vulnerabilities
  • Call it Netbook, Smartbook, or “Low-cost small notebook PC” - It is Great for Linux
  • The Week of the Linux Desktop
  • USN-781-2: Gaim vulnerabilities
  • USN-781-1: Pidgin vulnerabilities
  • USN-780-1: CUPS vulnerability
Archive Syndicate content

Recent comments

  • 1) # ./mkrawdev.sh ./mkrawdev.sh: line 6: ошибка синтаксиса окол
    8 weeks 1 day ago
  • 1) # ./mkrawdev.sh ./mkrawdev.sh: line 6: ошибка синтаксиса окол
    8 weeks 1 day ago
  • Aries Register is the best choice in Europe.
    17 weeks 6 days ago
  • Re: wireless
    20 weeks 3 days ago
  • wireless
    20 weeks 6 days ago
  • Re: Setting up wvdial to support Three
    24 weeks 6 days ago
  • Setting up wvdial to support Three
    26 weeks 1 day ago
  • не проходит built + raw device
    33 weeks 6 days ago
  • Re: Knol is not a Wikipedia clone
    38 weeks 2 days ago
  • Re: THANK YOU SOOOOO MUCH!!!
    38 weeks 2 days ago
All contents copyright © 2008, Dhuha Net. All rights reserved
Ubuntudoctor® is a member of the Dhuha Network. Privacy Policy
RoopleTheme