I recently ran into an issue where I needed to update the SSH host keys on a machine which was running NoMachine. In the process, I came across the following annoying error which was not at all indicative of the actual issue
-- NX SERVER START: -c /usr/bin/nxserver - ORIG_COMMAND= -- NX SERVER START: - ORIG_COMMAND= Info: Using fds #4 and #3 for communication with nxnode. HELLO NXSERVER - Version 3.2.0-74-SVN OS (GPL, using backend: not detected) NX> 105 hello NXCLIENT - Version 3.2.0 NX> 134 Accepted protocol: 3.2.0 NX> 105 SET SHELL_MODE SHELL NX> 105 SET AUTH_MODE PASSWORD NX> 105 login NX> 101 User: awesomeuser NX> 102 Password: Info: Closing connection to slave with pid 6424. NX> 404 ERROR: wrong password or login NX> 999 Bye
I verified repeatedly that other methods for logging in were working properly. This problem was due to us using the SSH protocol for NoMachine logins. Unfortunately, this error is also not at all useful because it doesn’t show the actual problem. The problem was that the “nxserver” user had a known_hosts file containing the old ssh host key and for some reason it wouldn’t allow me to accept the new one. I simply removed the old key.
# rm /var/lib/nxserver/home/.ssh/known_hosts rm: remove regular file `/var/lib/nxserver/home/.ssh/known_hosts'? y
Once the old key was removed, I was once again able to login successfully. Curiously, the known_hosts file was not regenerated. I’m not exactly sure how it wound up there to begin with since this setup was created before I arrived.