The Full Enchilada

Fix Authentication Failed error: Get FreeNX NoMachine NX working on Mint 4.0 or likely any Ubuntu or Debian based Linux

by Admin on Apr.23, 2008, under Linux Unix Stuff, The Beginning

Well I didn’t have a good time getting the NXSERVER from NoMachine to work right after downloading the .deb debian package files from their website, the client, the node, and the server module.

(Windows NX client dies/exits with this error:)
NX> 200 Connected to address: xx.xx.xx.xx on port: 22
NX> 202 Authenticating user: nx
NX> 208 Using auth method: publickey
NX> 204 Authentication failed.

Apparently NX server installs the ssh keys in the wrong place, when you try to login with the NX client it looks in some /usr/NX/share/ instead of /usr/NX/etc/keys and the easy fix is to simply run /usr/NX/bin/nxserver –keygen and it will recreate keys in the right place, then just go and recopy the key from inside the client .key file in the shared keys directory and paste it in your NX CLIENT and the connection will then complete successfully. If you don’t know where nxserver is just try to do a whereis nxserver or which nxserver or use locate or do a find / -name nxserver

Well, I hope this helps someone get their FreeNX remote control software working because I sure don’t want anyone suffering through the pitiful performance of VNC!

Might I add that I find Mint to be a wonderful Ubuntu/Debian based distribution, highly recommended especially for those who don’t just need it as a server but also as their primary DESKTOP operating system. This Mint OS has it all, plays all your music, movies, DVDs out of the box. You can still install Automatix or any other Debian .deb packages or use the built-in excellent Synaptic package manager or the unique MintInstall to install popular software with one click of a button off an ever-growing list on the website.

I run Mint 4.0 as a VM (VMWARE Virtual Machine) under 64-bit CentOS x86_64 4.2 and its nice to know FreeNX supports file/printer sharing and multimedia for rerouting AUDIO from the server to the client.

Software Developers will LOVE the one click install of the ECLIPSE IDE and Mono .Net platform. If you thought Ubuntu was great, think of this as a special MINT version!

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists

:

Comments
Jan 29, 2009
3:01 pm
#1 Luiz Guaraldo :

And if after it all a continue to have error on authentication when give /usr/NX/bin/nxserver –status ?

Mar 13, 2009
7:19 am

Sorry, your comment was buried in a ton of spam, hope you were able to fix your nxserver, see my rant on the blog spam here http://thefullenchilada.com/newstuff/i-thought-wordpress-was-great-wanna-know-a-secret-its-a-piece-of-crap.htm

Jun 15, 2009
11:49 pm
#3 Dave :

ah, ok double dashes don’t come through here, – - rather than “-”…

Jun 15, 2009
11:50 pm
#4 Dave :

Great stuff, this worked perfectly (–keygen rather than -keygen though) – Thanks!

Sep 22, 2009
12:06 pm
#5 Eric :

Dude! This is sweet! I couldn’t get this stuff working for anything, then I stumbled upon your site.

VNC kinda sucked over all but the fastest connections, but freenx is really nice!

One thing to note: I’m running Fedora 11 and yum’ed the freenx package. On my system I had to run:

/usr/libexec/nx/nxkeygen

Nov 4, 2009
12:58 am
#6 Aaron :

Hey Guys,

I have been looking for a fix for this issue for aggeeesss and even though i have followed step-by-step i am still receiving the below error, the only way i have been able toi fix is to re-install the OS haha dont want to do that again can anyone help me out, driving me NUTS.

NX> 203 NXSSH running with pid: 5100
NX> 285 Enabling check on switch command
NX> 285 Enabling skip of SSH config files
NX> 285 Setting the preferred NX options
NX> 200 Connected to address: xx.xxx.xxx.xxx on port: 22
NX> 202 Authenticating user: nx
NX> 208 Using auth method: publickey
NX> 204 Authentication failed.

Nov 4, 2009
5:05 pm

Hi, did you find the location of the “key” files? what linux distro are you using?
did you successfully run nxkeygen command or nxserver –keygen?
keys might be in /usr/NX/share
you could try duplicating the key files so they are located in both /usr/NX/share and /usr/NX/etc/keys or other NX directory that it might expect the keys to be in, depending on the linux distro or verison of nxserver…

Nov 5, 2009
4:47 am
#8 Aaron :

Sorry totally forgot all the relevant information
running Ubuntu Server 9.04

I was successfully able to run nxserver –keygen then imported the newly generated default.id_dsa.key into my nxclient .

ill try duplicating the files now and see how that goes. thanks!

Nov 5, 2009
4:55 am
#9 Aaron :

BOW bow! GRRR! duplicating files also had 0 effect .. i might have to go back to VNC *shudder*

after using NX i dont know how i could use anything else.

Nov 5, 2009
11:16 am

Ah, i pity anyone using VNC! I hope you can get NX working. Did you install freenx using apt-get install or manually?

After you ran nxserver –keygen where was the new key created? was it at /usr/NX/share/keys/default.id_dsa.key ? or where?

You can try stopping and restarting NX server and I assume you can successfully make SSH connections with putty etc into your box, just making sure there’s no issue with your SSH.

You might also want to try adding a local nxserver ‘user’ with same name as the SSH/shell username. ie run something like

sudo /usr/NX/bin/nxserver –useradd USER

Also might want to check your file permissions…
chown nx:root default.id_dsa.pub
chmod 0644 default.id_dsa.pub

you could even try nxserver –keyrestore and see if it renames your key by adding “.backup” to it…(should restore to default keys from nomachine)

Also wouldn’t hurt combing through your NX server config file…
There’s no reason it shouldn’t work, don’t give up just yet….

Nov 6, 2009
1:56 am
#11 no go :

nxserver –keygen
NX> 100 NXSERVER – Version 3.2.0-73 OS (GPL, using backend: not detected)
NX> 500 Error: Function –keygen not implemented yet.
NX> 999 Bye

Nov 6, 2009
7:57 am

ah, try with a single ‘-’ and also with double ‘- -’ and see if makes difference, also i think some versions of of nxserver have a standalone “nxkeygen” script or binary that you can run. ( for example Eric above mentioned there’s /usr/libexec/nx/nxkeygen on his redhat fedora distro..)

Dec 26, 2009
8:25 pm
#13 godfearer401 :

My NX worked until I set up and started using ssh with putty. I have now spent about 6 months trying to figure out how to restore service and am limping along using vnc. I thought the note regarding Fedora 11 might help, but in the end, I continue to be unsuccessful.

Here is what I am confused about. Since I am getting the error “Authentication failed for user ?usermae?”, it makes me think the key is fine. If I didn’t have the right key, it would give me the error “Server not installed or NX access disabled”. So, I think I am getting accepted by the nxserver. It appears that it doesn’t recognize me as a user. A very disappointing aspect of my attempts is that when I get the “Authentication failed for user ?usermae?”, I don’t have the “Detail” button available. Instead it is grayed out. I think if I had the information behind the detail button, that might provide more of a clue.

Another thing I don’t understand is that when I have the wrong key and I get “Server not installed or NX access disabled” I can see the details and the details say that user “nx” couldn’t be found. That is not the user I was attempting to long in as, so why is it even trying user “nx”?

Dec 27, 2009
2:26 am

Hi GodFearer, I also feareth the Almighty ;)

Sorry to hear you’re having so much problems with NX, I hope I can help, I really feel your pain having to use VNC! Some questions for you, did you install it by RPM manually or with yum, how did you install and can you confirm the install directories for me, and also the keys directories, see some of the comments above as to why I’m asking.

Did you make your own key or did you try and use the KEY that comes with it after you installed NX? Also did you create the same username in the NX user accounts/database, ( nxserver –useradd test_user OR to list users nxserver –userlist and nxserver –usercheck USERNAME which verifies the public key for user also)? (otherwords do you have both Linux user account and nx account that are identical, also you’re not trying to do NX login as root right? (not that it’s not supposed to work, I can login as root or regular user straight with NX)

Do you have logging enabled, can you show me exact NX client error, and also perhaps server side log errors, might have been inserted into /var/log/messages or check your NX config files.

Dec 27, 2009
2:55 am
#15 godfearer401 :

Q1 ?did you install it by RPM manually or with yum?

I believe I originally installed by downloading the files from http://www.nomachine.com/download-package.php?Prod_Id=1347, which are RPM’s. However, after a couple of months of struggling, I have performed a yum install freenx overtop the original install.

Dec 27, 2009
2:59 am
#16 godfearer401 :

Q2 ?can you confirm the install directories for me?

Not confident which answers your question.

/usr/NX/ seems to be a location

/var/lib/nxserver seems to be a location as well.

you’ll have to help me more if this hasn’t answered your question.

Dec 27, 2009
3:04 am
#17 godfearer401 :

Q3 ?Did you make your own key or did you try and use the KEY that comes with it after you installed NX?

Most recently, I used keygen from /usr/libexec/nx/nxkeygen like Eric did above. This generated a key in the /usr/NX/etc/keys location.

Dec 27, 2009
3:10 am

Can you please confirm for me if your trying to login to NX as root or regular user, if you created your own key etc.. I’d actually recommend running /usr/NX/bin/nxserver –keyrestore to restore the original keys and then do a recursive search for *key.backup or *.backup to see for sure where the active keys were that were replaced. And again, is this user part of the nx users database?

Dec 27, 2009
3:17 am
#19 godfearer401 :

Q4 ?Also did you create the same username in the NX user accounts/database, ( nxserver –useradd test_user OR to list users nxserver –userlist and nxserver –usercheck USERNAME which verifies the public key for user also)? (otherwords do you have both Linux user account and nx account that are identical,?

I used –useradd to add my username. So, when I do –userlist, my username shows up, but it is the only one. There is no nx username.

I did a cat /etc/passwd and did find the following:

nx:x:495:491::/var/lib/nxserver/home:/usr/libexec/nx/nxserver

–usercheck? Yes, I think I did a usercheck…what I remember is that I got feedback that the key was ok.

?do I have a linux and nx account that are identical? Don’t know. Identical in what way? As you see above, I did confirm there was an nx user, but I don’t know what the password would be.

Dec 27, 2009
3:21 am
#20 godfearer401 :

Q11 ?Can you please confirm for me if your trying to login to NX as root or regular user?

I am trying to login as my own user account…not as root.

Not that I have been trying to login as root, but since you asked…I tried to login as root just to see what would happen and I got “NX detected that a session is being run as an account having administrative privileges…” I am sure you know that error warning.
Nevertheless, I get “authentication failed as root user”.

Dec 27, 2009
3:23 am

I’d try something quick, like do what i recommended above with the keyrestore command and find the backups…you can also beforehand copy the files with the active key to back them up. Then see where the .backup files were put after the keyrestore. Then use the new KEY, insert it into your CLIENT and try to connect. sorry I’m kind abusy with stuff right now so can’t give you my undivided attention. That being said if you’re willing to trust me, you can make me an account and I can take a look for you later tonight if I can or tomorrow…

Dec 27, 2009
3:24 am
#22 godfearer401 :

Q5 ?Do you have logging enabled?

Haven’t figured out how to turn logging on or where to turn it on.

Dec 27, 2009
3:32 am
#23 godfearer401 :

I’ll see if I can determine what you are recommending above and perform that to see if it workds. However, I want to pose a question. Since I am getting the “Authentication failed for user ?username?”, doesn’t that show that the keys are actually working already? Seems like the problem is not the key, but the basic nx account in Fedora 11. Based on what I have seen, it appears that despite me logging in with my own account, the nxserver is assuming I am logging in with the nx account, or at least nxserver feels the need to check the creditials of the nx account.

What is the password for the nx account? If I can change the password, should I change it to the same thing as my personal account (ie the one I am trying to log in as)?

I am happy you are on and attempting to look at my questions. Thanks. I certainly understand your lack of time.

Dec 27, 2009
3:53 am
#24 Admin :

To answer your question, nope sorry the error you got I don’t believe rules out a KEY issue. You can try something if you want, copy the client.id_dsa.key to another system and try to ssh from that system into the system with the NX server as user ‘nx’. Of course you would copy the client.id_dsa.key (might be at /usr/NX/etc/users.id_dsa) to the appropriate place, in home dir of user /.ssh/id_dsa or /.ssh/authorized_keys or if not sure then do ssh like ssh -i /pathtotheID_DSAKEY nx@theNXserver …and tell me what you get…

if u want to clean house,nxsetup –install –clean –purge or nxserver –install –setup-nomachine-key –clean –purge

Dec 27, 2009
3:56 am
#25 godfearer401 :

I think I am going to clean house…then I am going to re-install with yum install freenx

Dec 27, 2009
4:04 am

ok, good luck, let me know how it goes, I might be away for a while but will check your comments…

Jan 31, 2010
7:44 pm
#27 hoosfoos :

Came across this thread while troubleshooting my NX installation (Ubuntu 9.1 running NXserver, accessing with Windows client). I was getting the same authentication error when trying to access, even after copying keys and all that rigamoroll (sp?) Anyway, in the end Godfearing’s hunch pointed me in the right direction. I noticed the connection attempting to login as user = nx as well. I opened up my SSHD_config file on the Ubuntu NX server and added “nx” to the “AllowUsers” line in this file, re-started the ssh service and wa-la – it worked! My sshd_config file was found at /etc/ssh directory. sudo gedit /etc/ssh/ssh_config

“AllowUsers matt nx”

Good luck to all trying to get NX working. Worth the time and effort IMHO.
Add “nx” to line

Feb 12, 2010
8:42 pm
#28 Admin :

Sorry it took forever to whitelist you, been very busy and comment was buried in spam. But very GOOD POINT about AllowUsers and also AllowGroups, some people might have an “AllowGroups sshlogins” in their sshd_config file and should make sure that they edit their /etc/group file and for sshlogins group make sure to add ‘nx’ as part of that group. It usually helps to keep an eye on the /var/log/secure file for errors like user nx not allowed because none of user’s groups are listed in AllowGroups … and is also a good place to check you’re on the right track when you see messages like “Accepted publickey for nx from IPADDRESSofNXclient” …

Apr 28, 2010
5:31 am
#29 byrnespd :

Thanks hoosfoos! Adding my username to the AllowUsers line cleared up the problem.

Jun 25, 2010
10:01 am
#30 Suhas :

Since you have written this wonderful article, is there nay way you can give a command list for fresh install of FreeNX please?
I think I have done everything correctly but still the same error. I am using Ubuntu 9.10, Thanks for your help

Jun 25, 2010
10:50 am
#31 Suhas :

This is site that helped me further, hope some one finds this useful as well

http://wiki.centos.org/HowTos/FreeNX

Jul 3, 2010
6:36 pm
#32 Admin :

Suhas, sorry i just noticed your posts I hope you got your setup working ok, if you don’t have it working right you should try a complete uninstall remove and try redoing, or perhaps try with direct downloads from nomachine.com website instead of using yum or apt management tool…

Aug 2, 2010
8:46 am
#33 JamesJ :

In case it should help anyone else, I had the same problem as mentioned by numerous other people above. The problem turned out to be that in Ubuntu my account was named “james” (lowercase j) but in the NX Client I entered “James” (upper J) as the login ID. After I changed my login id to be all lower case it worked.
Sadly, now I’m remembering why I gave up on Unix 15 years ago…It shouldn’t be this difficult.

Leave a comment

Email

Website

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...