Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Network authentication using NIS fails

In our office we have a Linux server which we have been authenticating against using NIS for some years (certainly using 10.5 and 10.6). Since installing 10.7, we can no longer authenticate so logins fail.


When I use Directory Utility, it seems to be able to contact the NIS server and can list out the various maps that it can see there (eg, hosts, mounts, passwd). Using dscl, I can navigate to /NIS/object-craft.com.au/Users/bgg and my user details are all listed there correctly. This makes me believe that the NIS connection between my machine and the server is working correctly. Further to this, the automounts served from the server work perfectly.


The problem only seems to occur when I try logging in. There's a yellow alert next to the username on the login panel saying that only some network accounts are accessible.


When I try to login, in /var/log/opendirectoryd.log sees lines like:


2011-07-22 19:56:23.449 EST - failed to get YP map list


This appears to come from the file /System/Library/OpenDirectory/Modules/nis.bundle/Contents/MacOS/nis. That leads me to think that OpenDirectory isn't being updated correctly with the NIS server's address. I don't know what the mechanism is that makes that work. I've tried using odutil but that hasn't proved very useful.


Does anyone know how to get this working? I'm really stumped.


Thanks,


Ben.

Posted on Jul 23, 2011 4:06 AM

Reply
66 replies

Sep 21, 2011 10:11 AM in response to dcharland

We've confirmed that the following changes work for us:


- nis server must provide a shadow.byname map for shadow passwords.

- nis user account passwords must be des encrypted.


I imagine there must be a way to configure pam on macos lion to support md5 or other encryption.


Oddly, ssh login as any user other than root is failing...not sure why yet. /var/log/secure.log reports:


Sep 21 13:06:37 x sshd[2770]: error: PAM: permission denied for x from x via x

Sep 21, 2011 10:57 AM in response to holycrapallthealiasesaretaken

Our NIS server does not provide a shadow.byname map for shadow passwords. As I mentioned before, encrypted passwords are merged into our passwd map. This works fine for us.


The root account is a local account and should never rely on NIS for password. How would you log on as root on a system that has no network access or that is booted in single-user mode? The admin account on MacOS does not have all the privileges that the root account has.

Sep 21, 2011 12:23 PM in response to dcharland

My mistake, I've tested again and find that shadow.byname is _not_ required.


However, I'm glad to know that it does in fact work to have nis shadow passwords with a macos lion nis client since shadow passwords preferable. The only reason we still support nis non-shadowed passwords on any of our nis servers is for older nis clients that can't/don't/won't use nis shadow passwords. This used to be the case with older macos nis clients.


I've been working with nis (yp) since the days of sunos 4 (circa 1990), so I'm well aware that root uses a local file password, not an nis password. But thanks for feedback! 🙂


Now, if someone can just tell us how to configure a macos lion nis client to allow md5 or newer encryption, that'd

be swell.

Oct 13, 2011 6:29 AM in response to Ben Golding

Confirmed... no change under 10.7.2.


We're also reasonably confident that the issue boils down to the NIS password encryption/hashing. Looks like Lion currently only supports DES (or rather, does not support MD5). We created a test Ubuntu 11.10 server running NIS using DES encryption, and were able to authenticate to Lion.


This is something of a pain since our current user passwords are all MD5 encrypted and I'm guessing that the only way forward would be to switch our NIS servers to DES and have all our users re-do their passwords. Which is definitely something we'd rather not do unless absolutely have to.


So partial progress, but all in all Lion is not worth the upgrade from Snow Leopard...

Nov 2, 2011 5:40 PM in response to Thomas A. Fine

I was looking at some other stuff (an Apple video about tips and tricks for Terminal, if you must know) and stumbled across a command I didn't know about, createmobileaccount (somewhat inconveniently located in /System/Library/CoreServices/ManagedClient.app/Contents/Resources/). This appears to be used to create a secondary auth so users authenticating against a central server can still log in when they are disconnected from the network.


I wondered whether we could set up a workaround to put in a place a secondary auth key so that when the NIS auth failed, it tried against a local key?


I don't know enough about createmobileaccount to feel confident about whether this would work, how to do it exactly and, perhaps more importantly, how to undo it.


Perhaps someone else here has some more experience with this?

Nov 18, 2011 11:57 AM in response to Ben Golding

So, I see that this (NIS authentication failing for Lion clients) issue persists.


My NIS server is running Solaris, which supports several password encryption schemes: DES, MD5, Blowfish, Sun's MD5 variant, SHA-256, and SHA-512 (my users are currently using MD5 but I'd like to migrate to SHA-512 one day). I performed an experiment this morning in which I tried to authenticate from a Lion (10.7.2) client, using each of these encryption methods on the server. With the exception of DES, they ALL failed.


As security professionals know, DES is easily broken these days, so using it on my network isn't going to happen. Until Apple fixes this major security regression, I will not use Lion. How this wasn't spotted in QA testing is beyond me...


I have updated my support call with Apple with the above info, so hopefully Apple's engineers will be able to solve this once and for all RSN.

Dec 14, 2011 1:43 PM in response to mrtips

Yep, my NIS server is listed in the plugin.


What makes this even more ironic is that Lion uses SHA-512 for local users. If Apple had broken MD5 NIS passwords such that one could use only SHA-512, I wouldn't be so distraught.


I can't express enough how surprised I am that this SNAFU got past Apple's QA and regression testing (they DO perform regression testing, don't they?!), nor how disappointed I am that a fix is taking so long to surface.


Perhaps if they spent less time changing UNIX stuff behind the scenes and more time on testing, this sort of thing wouldn't happen. (I mean, really: is there a reason to not use /etc/shadow to store local users' passwords?!)

Dec 22, 2011 11:41 AM in response to Ben Golding

So at this point has anyone heard as to whether or not Apple has committed to addressing this issue?


Also, I don't know why - and perhaps it is something I am doing wrong - but at this point it looks like LDAP authentication does not quite happen either. I've got a FreeIPA server running and it doesn't look like my Mac OS X Lion machine is in any hurry authenticating to it. Anybody know what the status is on that?


Thanks.


Boris.

Network authentication using NIS fails

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.