Problems with NX Server 3.4.0 on CentOS 5

This morning at The Shop I was installing NoMachine on a CentOS 5 server and an XP Client. The client was fine, but I kept getting SSH errors about Authentication failed. I looked at the NoMachine web site, and their knowledge base recommendation was to make sure the permissions on the ~/.ssh/config file were set properly.

Did that, didn't work.

I then stumbled onto the key to the problem: the nxserver wasn't really running. When I found this article, I saw that I had a way to check and see if it was really running:

  $ sudo /usr/NX/bin/nxserver --status

and if all is going well, we'll see something like:

  $ sudo /usr/NX/bin/nxserver --status 
  NX> 900 Connecting to server ...
  NX> 110 NX Server is running.
  NX> 999 Bye.

but if there's a problem - like I had, it'll look like this:

  $ sudo /usr/NX/bin/nxserver --status 
  NX> 900 Connecting to server ... 
  NX> 204 Authentication to NX server failed. 
  NX> 110 NX Server is stopped. 
  NX> 999 Bye.

OK... we now have a way to prove it's the server without including the client. Progress. Unfortunately, the solution was very difficult to find. Forget the knowledge base... that didn't help. Turns out, several of the guys here did figure this out in the past, but have since forgotten the exact solution.

So they had to play around. So they played.

The solution was in the user nx that's installed with the RPMs. This guy doesn't have the proper groups, so we had to manually add him to the localssh group:

  localssh:x:500:dbususer,...,nx

where the key is that the nx user be added (with a comma separator) on the end of the line. Save that, restart sshd with:

  $ sudo /etc/init.d/sshd restart

and you're ready to go. You just need to restart the NX Server:

  $ sudo /etc/init.d/nxserver stop
  $ sudo /etc/init.d/nxserver start

then:

  $ sudo /usr/NX/bin/nxserver --status 
  NX> 900 Connecting to server ...
  NX> 110 NX Server is running.
  NX> 999 Bye.

works just fine.

Whew! That was a ton of work to find the three characters to type into the right fine to get it to work.