NX server package is not included on Ubuntu distro as default. So, you need to add repository URL on sources.list at /etc/apt. Let’s configure FreeNX server side first.
Server side configuration
1. Modify source list file at /etc/apt/sources.list. Add below source of repository URL.
deb http://ppa.launchpad.net/freenx-team/ppa/ubuntu lucid main deb-src http://ppa.launchpad.net/freenx-team/ppa/ubuntu lucid main
chris@Kubuntu$ sudo apt-get update
chris@Kubuntu$ sudo apt-get install freenx-server or freenx
:
After this operation, 13.9MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Install these packages without verification [y/N]? y
:
Processing triggers for man-db …
Processing triggers for ureadahead …
Setting up tcl8.5 (8.5.8-2) …
Setting up expect (5.44.1.14-5) …
Setting up libxcomp3 (3.4.0-7-0~ppa1~lucid1) …
Setting up libxcompext3 (1:3.4.0-1-0ubuntu2~ppa3~lucid1) …
Setting up libxcompshad3 (3.4.0-3-0~ppa1~lucid1) …
Setting up nxlibs (1:3.4.0-3-9-0~ppa1) …
Setting up nxagent (1:3.4.0-3-9-0~ppa1) …
Setting up nx-common (0.3.1+svn59-0~ppa1~lucid1) …
adduser: Warning: The home directory `/var/lib/nxserver/home/’ does not belong to the user you are currently creating.
Setting up freenx-server (0.7.3.git100327.e224628-0~ppa7~lucid) …
update-alternatives: using /usr/lib/nx/nxserver to provide /usr/bin/nxserver (nxserver) in auto mode.
start: Unknown job: freenx-server
Setting up freenx-session-launcher (0.7.3.git100327.e224628-0~ppa7~lucid) …
Processing triggers for libc-bin …
ldconfig deferred processing now taking place
root@kubuntu:/etc/apt#
:
:
2. Modify node.conf file at /etc/nxserver directory
Change from
# This adds the passdb to the possible authentication methods
#ENABLE_PASSDB_AUTHENTICATION="0"
to
# This adds the passdb to the possible authentication methods
ENABLE_PASSDB_AUTHENTICATION="1"
3. Adding permissions for the users
pico /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys2
AllowUsers nx chris
4. Creating client id dsa key
root@ubuntu:/home# /usr/lib/nx/nxkeygen
Unique key generated; your users must install
/var/lib/nxserver/home/.ssh/client.id_dsa.key
on their computers.
root@ubuntu:/home#
5. Create users.id_dsa file at /etc/nxserver directory if it is not existing and copy key from /var/lib/nxserver/home/.ssh/client.id_dsa.key
6. Adding users
root@kubuntu:/etc/nxserver# nxserver –adduser chris
NX> 100 NXSERVER – Version 3.2.0-74-SVN OS (GPL, using backend: 3.4.0)
egrep: /etc/nxserver/passwords: No such file or directory
cp: cannot stat `/etc/nxserver/passwords’: No such file or directory
NX> 1000 NXNODE – Version 3.2.0-74-SVN OS (GPL, using backend: 3.4.0)
cat: /etc/nxserver/users.id_dsa.pub: No such file or directory
cat: /etc/nxserver/users.id_dsa.pub: No such file or directory
NX> 716 Public key added to: /home/chris/.ssh/authorized_keys2
NX> 1001 Bye.
NX> 999 Bye
root@ubuntu:/etc/nxserver# nxserver –passwd chris
NX> 100 NXSERVER – Version 3.2.0-74-SVN OS (GPL, using backend: 3.4.0)
New password:
Password changed.
NX> 999 Bye
root@ubuntu:/etc/nxserver#
7. DB permission change for nx account
chris@Kubuntu$ sudo chown nx:root /var/lib/nxserver/db/*
8. Restart ssh and freenx server
root@ubuntu:/etc/nxserver# /etc/init.d/ssh restart
* Restarting OpenBSD Secure Shell server sshd
root@ubuntu:/etc/nxserver# nxserver –restart
NX> 100 NXSERVER – Version 3.2.0-74-SVN OS (GPL, using backend: 3.4.0)
NX> 123 Service stopped
NX> 122 Service started
NX> 999 Bye
Troubleshooting
NX> 148 Server capacity: not reached for user: chris
nx>468: /var/lib/nxserver/db/running/sessionId Permission denied
/usr/bin/nxserver: line 468: /var/lib/nxserver/db/running/sessionId{2A33A32ACAC30A51AEF1702459CD146A}: Permission denied
/usr/bin/nxserver: line 224: /var/lib/nxserver/db/running/sessionId{2A33A32ACAC30A51AEF1702459CD146A}: No such file or directory
solution> sudo chown nx:root /var/lib/nxserver/db/*
Reference
https://help.ubuntu.com/community/FreeNX
http://geekozoid.blogspot.com/2008/06/best-remote-access-system-for-ubuntu.html