Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using LDAP+kerberos to authenticate against Active Directory on Windows 2003 R2. My krb5.conf and ldap.conf appear to be correct (according to pretty much every sample I found on the 'net). I can login to the host with both password and ssh keys. When I run getent passwd, all my ldap user accounts are listed with all the important attributes. When I run getent group, all the ldap groups and their gid's are listed, but no group members. If I run ldapsearch and filter on any group, the members are all listed with the "member" attribute. So the data is there for the taking, it's just not being parsed properly. It would appear that I simply am using an incorrect mapping in ldap.conf, but I can't see it. I've tried several variations and all give the same result.

Here is my current ldap.conf:

host <ad-host1-ip> <ad-host2-ip>
base dc=my,dc=full,dc=dn
uri ldap://<ad-host1> ldap://<ad-host2>
ldap_version 3
binddn <mybinddn>
bindpw <mybindpw>
scope sub
bind_policy hard 
nss_reconnect_tries 3
nss_reconnect_sleeptime 1
nss_reconnect_maxsleeptime 8
nss_reconnect_maxconntries 3
nss_map_objectclass posixAccount User
nss_map_objectclass posixGroup Group
nss_map_attribute uid sAMAccountName
nss_map_attribute gidNumber msSFU30GidNumber
nss_map_attribute uidNumber msSFU30UidNumber
nss_map_attribute cn cn
nss_map_attribute gecos displayName
nss_map_attribute homeDirectory msSFU30HomeDirectory
nss_map_attribute loginShell msSFU30LoginShell
nss_map_attribute uniqueMember member
pam_filter objectcategory=User
pam_login_attribute sAMAccountName
pam_member_attribute member
pam_password ad

Here's the kicker: this config works 100% fine on a different linux box with a different distro. It does not work on the distro I am planning on switching to. I have installed from source the versions of pam_ldap and nss_ldap on the new box to match the old box, which fixed another problem I was having with this setup.

Other relevant info is the original AD box was Windows 2003. It's mirror died a horrible hardware death so I'm trying to add two more 2003-R2 servers to the mirror tree and ultimately drop the old 2003 box. The new R2 boxes appear to have joined the DC forest properly.

What do I need to do to get groups working? I've exhausted all the resources I could find and need a different angle. Any input is appreciated.


Status update, 7/31/09

I have managed to tweak my config file to get full info from the AD and performance is nice and snappy. I replaced the back-rev'd copies of pam_ldap and nss_ldap with the current ones for the distro I'm using, so it's back to a standard out-of-the-box install. Here's my current config:

host <ad-host1-ip> <ad-host2-ip>
base dc=my,dc=full,dc=dn
uri ldap://<ad-host1> ldap://<ad-host2>
ldap_version 3
binddn <mybinddn>
bindpw <mybindpw>
scope sub
bind_policy soft 
nss_reconnect_tries 3
nss_reconnect_sleeptime 1
nss_reconnect_maxsleeptime 8
nss_reconnect_maxconntries 3
nss_connect_policy oneshot
referrals no
nss_map_objectclass posixAccount User
nss_map_objectclass posixGroup Group
nss_map_attribute uid sAMAccountName
nss_map_attribute gidNumber msSFU30GidNumber
nss_map_attribute uidNumber msSFU30UidNumber
nss_map_attribute cn cn
nss_map_attribute gecos displayName
nss_map_attribute homeDirectory msSFU30HomeDirectory
nss_map_attribute loginShell msSFU30LoginShell
nss_map_attribute uniqueMember member
pam_filter objectcategory=CN=Person,CN=Schema,CN=Configuration,DC=w2k,DC=cis,DC=ksu,DC=edu
pam_login_attribute sAMAccountName
pam_member_attribute member
pam_password ad
ssl off
tls_checkpeer no
sasl_secprops maxssf=0

The remaining problem now is when you run the groups command, not all subscribed groups are listed. Some are (one or two), but not all. Group memberships are still honored, such as file and printer access. getent group foo still shows that the user is a member of group foo. So it appears to be a presentation bug, and does not interfere with normal operation.

It also appears that some (I have not determined exactly how many) group searches do not resolve correctly, even though the group is listed. eg, when you run "getent group bar", nothing is returned, but if you run "getent group|grep bar" or "getent group|grep <bar_gid>" you can see that it indeed listed and your group name and gid are correct.

This still seems like an LDAP search or mapping error, but I can't figure out what it is. I'm a heckuva lot closer than earlier in the week, but I'd really like to get this last detail ironed out.

share|improve this question
    
Did the old, dead AD system have Microsoft's Unix Services for Windows installed? Is the problem only with getent? That is, do individual users have the right group when running /usr/bin/id ? –  kmarsh Aug 5 '09 at 17:11
1  
what does this problem box's /etc/nsswitch.conf say? –  IdaWong Jun 8 '10 at 16:31
    
+1 for IdaWong; nsswitch.conf is the first place I'd look for problems with getent. –  Handyman5 Jul 4 '11 at 16:51
add comment

2 Answers 2

It might be the same case I've run onto not a long time ago. If your AD group has too many members, it caused such error in Linux (somewhere on getent level or just before it - ldapsearch worked fine).

More precisely the error is not about a specific number of members, but rather about the number of characters per "group line" (think line from /etc/group) being greater than 1023 characters. I didn't look into why this limit is there and why 1024. I've just created a second group and moved excessive members there.

share|improve this answer
add comment

This is actually a pretty easy thing to fix, you need to add the following to your ldap.conf:

nss_schema rfc2307bis

This tells it to enumerate groups with a DN instead of just their CN. Also note that you can use the RFC2307 native attributes now (gecos, uid etc) as long as you have a 2003R2 DC or newer.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.