Unable to make a Windows server, Linux client key-based authentication work

Forum / NoMachine for Windows / Unable to make a Windows server, Linux client key-based authentication work

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #36227
    John3245
    Participant

    Hello !
    I am trying to setup a Windows server on which I’ll connect with a Linux client, using key-based authentication.

    I have followed this article several times but couldn’t make it work.

    The server is on Windows 10.
    The client is on Linux Mint 20.1.
    Both are running NoMachine 7.7.4

    Here’s what I did:

    1) I ran the NoMachine installer using user account “windowsuser”

    2) On the Linux client, I have issued
    ssh-keygen -t rsa -b 4096

    Here’s the output. When prompted to enter a passphrase, I left it empty :

    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/linuxuser/.ssh/id_rsa):
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /home/linuxuser/.ssh/id_rsa
    Your public key has been saved in /home/linuxuser/.ssh/id_rsa.pub
    The key fingerprint is:
    SHA256:0aV4jo+mMgDUs1f+Qfy1+1ObsoMpFpifYUktvKL7GiB linuxuser@linuxhost
    The key’s randomart image is:
    +—[RSA 4096]—-+
    |  . ….    .    |
    (…)
    | o=..oo .  .=    |
    +—-[SHA256]—–+

    3) On the Windows server, I have copied and renamed the previously generated id_rsa.pub to c:\Users\windowsuser\.nx\config\authorized.crt
    4) I have restarted the NoMachine server
    5) On the Linux client I added a new server in the NoMachine interface
    a) In the address tab I added the name and port of the server and left the protocol as NX
    b) In the configuration tab I selected “Use key-based authentication with a key you provide”, clicked on “Modify”, selected the file id_rsa generated in step 1, and checked “Import the private key to the connection file”
    6) On the Linux client I clicked the “Connect” button in the top-right corner

    I am then prompted to enter a username and passphrase. I understand I can leave the passphrase empty as I have provided none in step 1.
    But which username should I use ? The Linux one or Windows one ? I have tried both with no success.

    Here’s how my keys look like:

    id_rsa.pub (which became authorized.crt)

    sshr-rsa AAAAB3NzaC1yc2EBBCCDFQABAAACAQCn7MspZYgz5isfYKHEqHYSliI9/uikiWO93bZVxUj58HhcNmrvf8cv37e1Bk1C/x8kSWfgReckf60EaAavqMXAYB (…) linuxuser@linuxhost

    id_rsa

    —–BEGIN OPENSSH PRIVATE KEY—–
    b3B5bnNzbC1rZ4ktdjEAABBCCBG5vimUAAAAEbmfuZQAAAAGJDEACBAAACFwAAAAdzc3gtez
    NhABBCAwEAAQAAAgEAp+p8VWWIM9orH2ChxKh2LJYiPf7ogXqrJIljtN22VcVI+fB4XDZq
    (…)
    —–END OPENSSH PRIVATE KEY—–

    Please find attached the logs I have found in c:\Users\windowsuser\.nx\

    Could you please let me know what I did wrong and what I should do to make it work ?
    Thank you !

    #36324
    John3245
    Participant

    Hi, just to let you know I managed to resolve it.

    I read somewhere else that having one of the computer with a capital letter in its name breaks the mechanism, so I renamed both computers, restarted the procedure and voila.

    #36350
    Britgirl
    Keymaster

    Thanks for letting us know. We have not been able to reproduce this problem – is it possible that you used the public key instead of private key when prompted?

Viewing 3 posts - 1 through 3 (of 3 total)

This topic was marked as solved, you can't post.