nx přístup ke vzdálenému serveru

1. Installing NX / FreeNX on the server

Currently there is a version of NX and FreeNX in the CentOS Extras repository.

To install the stable version of NX / FreeNX, issue this command from the server:

 

yum install nx freenx  

You may also download the RPMS from:

http://mirror.centos.org/centos/4/extras/i386/RPMS/

http://mirror.centos.org/centos/5/extras/i386/RPMS/

and the SRPMS from:

http://mirror.centos.org/centos/4/extras/SRPMS/

http://mirror.centos.org/centos/5/extras/SRPMS/

Note: Sometimes, there are issues that require the No Machine Client to also be installed on your NX server. If you are having issues such as the inability to close the client, please download the latest No Machine Linux Client RPM (see the Linux link below) and install it on your NX server. These issues are much less prevalent in versions of NX > 3 and freenx > 0.7.

 

2. Key-based authentication

Note: Although this section is optional, it is recommended that key-based authentication be implemented.

Copy a minimal configuration file for nxserver :

 

cd /etc/nxserver ; cp node.conf.sample node.conf  

If your machine is connected to the Internet, you’ll probably want to disallow ssh password authentication (which is advised but not mandatory). Edit the /etc/ssh/sshd_config file and change/add the following lines:

 

PasswordAuthentication no          AllowUsers nx  

Don’t forget to restart the sshd daemon after making that change:

 

service sshd restart  

By default, if you try to connect to the NX server, it will use the nx account for the ssh connection
(with key authentication) but it will try also to connect in ssh with your own username/password
to the host you’re trying to reach.
Because we’ve disabled the PasswordAuthentication (the advised method),
we have to use the NX Database to allow pass-through authentication.
Be sure that /etc/nxserver/node.conf file contains the following line :

 

ENABLE_PASSDB_AUTHENTICATION="1"  

Nyní spustíme:

nxsetup –install –setup-nomachine-key

Toto způsobí:

 

Setting up /etc/nxserver …done
Setting up /var/lib/nxserver/db …done
Setting up /var/log/nxserver.log …done
Adding user „nx“ to group „utmp“ …done
Setting up known_hosts and authorized_keys2 …done
Setting up permissions …done
Setting up cups nxipp backend …done

—-> Testing your nxserver configuration …
Warning: Could not find nxdesktop in /usr/bin. RDP sessions won’t work.
Warning: Could not find nxviewer in /usr/bin. VNC sessions won’t work.
Warning: Invalid value „APPLICATION_LIBRARY_PRELOAD=/usr/lib/libX11.so.6.2:/usr/lib/libXext.so.6.4:/usr/lib/libXcomp.so.2:/usr/lib/libXcompext.so:/usr/lib/libXrender.so.1.2“. /usr/lib/libX11.so.6.2 could not be found. Users will not be able to run a single application in non-rootless mode.
Warning: Invalid value „DEFAULT_X_SESSION=/etc/X11/xdm/Xsession“
Users might not be able to request a default X session.
Warning: Invalid value „COMMAND_START_CDE=cdwm“
Users will not be able to request a CDE session.
Warning: Invalid value „COMMAND_SMBMOUNT=smbmount“. You’ll not be able to use SAMBA.
Warning: Invalid value „COMMAND_SMBUMOUNT=smbumount“. You’ll not be able to use SAMBA.
Error: Could not find 1.5.0 or 2.[01].0 or 3.[01].0 version string in nxagent. NX 1.5.0 or 2.[01].0 or 3.[012].0 backend is needed for this version of FreeNX.

Warnings occured during config check.
To enable these features please correct the configuration file.

<---- done —-> Testing your nxserver connection …
The authenticity of host ‚127.0.0.1 (127.0.0.1)‘ can’t be established.
RSA key fingerprint is 34:d0:fc:33:5f:67:ab:6f:cd:47:3b:df:76:27:85:96.
Are you sure you want to continue connecting (yes/no)?
Warning: Permanently added ‚127.0.0.1‘ (RSA) to the list of known hosts.
HELLO NXSERVER – Version 3.2.0-73 OS (GPL, using backend: not detected)
<--- done Ok, nxserver is ready.

PAM authentication enabled:
All users will be able to login with their normal passwords.

PAM authentication will be done through SSH.
Please ensure that SSHD on localhost accepts password authentication.

You can change this behaviour in the /etc/nxserver/node.conf file.
Have Fun!

 

ALE – soubor /usr/bin/nxdesktop_helper obsahuje chybu v řádcích:

# setup commandline
set — -u „$agent_user“ -k „$agent_keyboard“ -d „$agent_domain“ -f  $AGENT_EXTRA_OPTIONS_RDP „$agent_server“

 

je direktiva -s „$windows_app“

špatně a zapřičiňuje selhání při připojení k win desktopům pomocí rdp protokolu 🙁
Řešením je odstranit celou volbu -s „$windows_app“

 

International Keyboard Support

The NX Server requires a small modification of /etc/nxserver/node.conf as root to allow NX clients to use other keyboards settings than the US (QWERTY) one:

Locate the line in /etc/nxserver/node.conf reading:

       #AGENT_EXTRA_OPTIONS_X="" 

And change it to read:

       AGENT_EXTRA_OPTIONS_X="-xkbdir /usr/share/X11/xkb" 

Restart your NX Server with:

       nxserver --restart 

Then reconnect your NX Client and that’s it. You should now have a working international keyboard.

 

 

 

NEBO

Then create yourself a posix account (with useradd/passwd if not already done). Add this newly created user to the nxserver database:

 

nxserver --adduser myuser  NX> 100 NXSERVER - Version 1.5.0-60 OS (GPL)  NX> 1000 NXNODE - Version 1.5.0-60 OS (GPL)  NX> 716 Public key added to: /home/myuser/.ssh/authorized_keys2  NX> 1001 Bye.  NX> 999 Bye  

Assign a password for this user:

 

nxserver --passwd myuser  NX> 100 NXSERVER - Version 1.5.0-60 OS (GPL)  New password: Password changed. NX> 999 Bye 

<!>“ height=“15″ src=“http://wiki.centos.org/wiki/modern-CentOS/img/attention.png“ title=“<!>“ width=“15″ /> Don’t forget to add this new user on the AllowUsers line in the sshd_config file (for example: <em>AllowUsers nx myuser</em>) and then reload sshd (<strong>service sshd reload</strong>). ALE</p></div><div class=