NoMachine is a terminal server software that allows one to remotely connect to a remote desktop over a network (e.g. the Internet). It provides features similar to those found in products like Apple’s Back To My Mac, or protocols like RDP (Remote Desktop Protocol, used in Windows systems) or XVNC/X11 (used in UNIX systems). In this post, I’ll discuss release 4.X of NoMachine. Older versions like the 3.X releases, work in different, incompatible ways.
There are multiple editions of NoMachine’s server component. I’m interested just in the Free Edition, which is available at https://www.nomachine.com/download. I’ll ignore the Terminal Server and Enterprise editions, as they are generally expensive for the average home user to use.
The Free edition allows one to remotely connect to an existing desktop on a remote computer. For example, when installed on a Linux server, it attaches to the desktop session running on the console, allowing one to remotely control it. This works in a very similar way to what Apple’s Screen Sharing feature does.
According to https://www.nomachine.com/AR10K00728, the Free edition only supports the NX protocol for connecting and authenticating remotely to the server. The NX protocol supports password and public key authentication. For password authentication, nothing special has to be done. However, in order to enable public key authentication, one has to add the SSH public key to the NX configuration file that corresponds to the user. Based on instructions from https://www.nomachine.com/AR02L00785, it’s just a matter of concatenating the user’s public key to his ~/.nx/config/authorized.crt
file:
$ cat path/to/ssh-public-key >> ~user/.nx/config/authorized.crt
this had me stumped until i discovered there’s a difference between the keys generated by puttygen and the keys that work in nomachine. seems you have to convert putty keys into openssh format, or i guess create with openssh in the first place. found out how to convert here: http://stackoverflow.com/questions/2224066/how-to-convert-ssh-keypairs-generated-using-puttygenwindows-into-key-pairs-use
Pingback: Secure key-based authentication with NoMachine v4 [Free] on Windows – Need For Bits
On Windows to works is just execute the file “ssh-keygen.exe” from https://github.com/PowerShell/Win32-OpenSSH/releases/ to generate the keys on folder “c:\Users\YOUR-USERNAME\.ssh”. Then copy file from “id_rsa.pub” (public key) to “C:\Users\YOUR-USERNAME\.nx\config” and rename the file to “authorized.crt”.