I'm using openldap
+ nslcd
to connect to a LDAP server for authentication of some users (these users would want their passwords and most of their configuration shared over many devices). I don't control the LDAP server.
However, the synchronization came after the users already had dual accounts, so names of home folders don't match (and it's not wise to move them due to possible hardcoded paths in their scripts). I'm considering a hard linked directory, but I want to know if there is a way to override home folder for a specific user, which seems cleaner and sounds like it should be a common use case.
I was unpleasantly surprised that nslcd.conf
seems to accept only a single filter (per map=passwd
), and map
directives will simply replace the home for all users at once.
Is there a way around to elegantly "fix" single entries after LDAP lookup? My search mostly encountered answers that replace the pattern for all users, or give unhelpful answers (such as this one which simply overrides the previous filter).
What I think I need:
filter passwd (&(objectClass=inetOrgPerson)(<redacted>))
# the last part is wishful thinking, not actual syntax
map passwd homeDirectory "<redacted>" if (uid=<redacted>)
I'm new at LDAP so it's possible I don't entirely understand the order in which the transactions happen and whether it's PAM or nslcd that should do this. I realize this is not the best way to handle the situation properly, but I'd still like to know if it can be done.