1

I'm trying to setup passwordless SSH access.

My username is bmccann, so in /etc/ssh/sshd_config I added:

PermitRootLogin no
PasswordAuthentication no
AllowUsers bmccann nx

I ran ssh-keygen on the client and put ~/.ssh/id_rsa.pub from the client into ~/.ssh/authorized_keys on the server.

I can now login with no password using the ssh command. However, I can no longer access the machine via NX as long as /etc/ssh/sshd_config has "PasswordAuthentication no".

Server error logs:

$ grep NX /var/log/messages
Feb 11 01:25:51 bmccann-htpc NXSERVER-3.4.0-12[23552]: ERROR: Failed authentication. NXSsh exit status is:255 'NXNssUserManager::auth'
Feb 11 01:25:51 bmccann-htpc NXSERVER-3.4.0-12[23552]: Failed SSHd authentication for user 'bmccann', to '127.0.0.1', port '22': 'NX> 204 Authentication failed.\n ' 'NXNssUserManager::auth'
Feb 11 01:25:51 bmccann-htpc NXSERVER-3.4.0-12[23552]: ERROR: Error while trying to authenticate user:bmccann. NXNssUserManager::auth returned 255 'NXShell::handler_login'
Feb 11 01:25:51 bmccann-htpc NXSERVER-3.4.0-12[23552]: ERROR: failed 'sshd authentication' for user 'bmccann' from '108.29.137.64'. NXShell::handler_login NXShell 373

What do I need to do to restore my NX access? Is there something I need to setup in the NX client so that it no longer asks me for a password?

benmccann
  • 598
  • 2
  • 8
  • 21

2 Answers2

2

What do I need to do to restore my NX access?

Bring back the change in /etc/ssh/sshd_config and restart OpenSSH server.

Use password or authorized keys. Empty passwords not allowed with PAM authentication.

alvosu
  • 8,437
  • 25
  • 22
  • I ran ssh-keygen on the client. Then I put ~/.ssh/id_rsa.pub from the client into ~/.ssh/authorized_keys on server. Is that what you mean by authorized keys or do you mean that I need to enter a passphrase when I run ssh-keygen? – benmccann Feb 11 '11 at 08:47
  • No, passphrase not needed. Test ssh from client to server: ssh -vvv server – alvosu Feb 11 '11 at 08:56
  • Hmm, I am using authorized keys without a passphrase, so I'm not sure what's wrong. I've updated the question to make that clearer and provide some more details. Thanks so much for the help. – benmccann Feb 11 '11 at 09:35
  • AllowUsers myusername nx bmccann – alvosu Feb 11 '11 at 09:42
  • I only put myusername as an example because I wasn't sure it would be obvious my username was bmccann. I actually have "AllowUsers bmccann nx" in the file. Sorry for the confusion. I've clarified above. – benmccann Feb 11 '11 at 14:56
0

I couldn't find a way to get NX to stop prompting me for a password, but the following worked to allow a password to be used with NX:

EnableUserDB = "1"
EnablePasswordDB = "1"
sudo /usr/NX/bin/nxserver --useradd bmccann

I added more details on my blog.

benmccann
  • 598
  • 2
  • 8
  • 21