A user on our Opensuse 12.1 server was trying to mount an NFS directory and came to me saying that he had no username. His user configuration is identical to every other user on the system, so I suspected that LDAP was failing entirely, but it turns out to not be the case. He can, in fact, log in as his LDAP user on other systems and they successfully detect his name (i.e. whoami does not fail). Running whoami on every user on the server returns (non-truncated output):
$ for i in $(ldapsearch -LLL -x -H ldap://localhost uid | grep "^uid" | cut -d' ' -f 2); do [[ $(su $i -c whoami) == "$i" ]] || echo $i; done
whoami: cannot find name for user ID 1497
hisusername
Likewise, if I run groups on him on the LDAP server:
$ groups hisusername
hisusername : users faculty
$ su hisusername
[hisusername@server root]$ groups
users groups: cannot find name for group ID 1000
1000
This completely baffles me. I restarted slapd as well, and that unfortunately didn't fix anything.
The server is running sssd for name caching, but the problem persists after
systemctl stop sssd
rm -rf /var/lib/sss/db/**
systemctl restart sssd
Meaning that name caching is probably(?) not the issue
LDAP entries for working user account:
# hisusername-temp, people, linuxlab.<domain>.<tld>
dn: uid=hisusername-temp,ou=people,dc=linuxlab,dc=<domain>,dc=<tld>
cn: hisusername-temp
gidNumber: 100
homeDirectory: /home/hisusername-temp
loginShell: /usr/local/bin/redirsh
objectClass: top
objectClass: posixAccount
objectClass: inetOrgPerson
sn: hisusername-temp
uid: hisusername-temp
uidNumber: 1540
The faulty account:
# hisusername, people, linuxlab.<domain>.<tld>
dn: uid=hisusername,ou=people,dc=linuxlab,dc=<domain>,dc=<tld>
cn: His Name
gidNumber: 100
homeDirectory: /home/hisusername
loginShell: /usr/local/bin/redirsh
objectClass: top
objectClass: posixAccount
objectClass: inetOrgPerson
sn: hisusername
uid: hisusername
uidNumber: 1497