Forum / NoMachine for Windows / Unable to make a Windows server, Linux client key-based authentication work
Tagged: key-based authentication
- This topic has 2 replies, 2 voices, and was last updated 1 year, 6 months ago by Britgirl.
November 15, 2021 at 10:47 #36227John3245Participant
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:
The key’s randomart image is:
| . …. . |
| o=..oo . .= |
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
—–BEGIN OPENSSH PRIVATE KEY—–
—–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 !November 19, 2021 at 00:36 #36324John3245Participant
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.November 19, 2021 at 19:24 #36350BritgirlParticipant
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?
This topic was marked as solved, you can't post.