FreeNX server authenticate failure: nxserver: (nx) Failed login for user=xxx

When setting up freenx server with --setup-nomachine-key option (it uses the default nomachine key pair come with the distribution.) The nx clients failed login with authentication error. And the /var/log/auth.log of the nx server host shows
nxserver[10411]: (nx) Failed login for user=wilson from IP=
The reason is the nomachine key pair came with freenx distribution is no longer valid.


The solution is: generate custom keypair and distribute the key to the nx clients:
  1. On the nx server host, remove the old ssh key pairs for the nx user:
    sudo rm /usr/NX/home/nx/.ssh
  2. On the nx server host, generate new custom key pair:
    sudo /usr/NX/bin/nxsetup --install
    When asking:
    Do you want to use your own custom KeyPair? [y/N]
    Answer is y. It will generate files (key pair) in /usr/NX/home/nx/.ssh/. And /usr/NX/home/nx/.ssh/client.id_dsa.key is the file you need to distribute to your nx clients.
  3. In the configuration of NX client (Nomachine nx client or OpenNX client), import the newly generate key file: /usr/NX/home/nx/.ssh/client.id_dsa.key
  4. Now you should be able to login via nx client...

No comments:

Post a Comment