Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I recently asked a question here about getting Ubuntu to authenticate via LDAP against an OS X server. The good news is, I got it to work and the clients are now authenticating, but my problem now is that doesn't seem to be doing it's job. Here's my common-session file:

session sufficient
session [default=1]           
session requisite             
session required              
session required
session required skel=/etc/skel/
session optional              
session optional               nox11
session optional

Because of this, every time an LDAP user tries to login, gdm tells them that their home directory is set to /Network/[Servername]/User/[username]. Based on this error, I'm guessing that is being overridden by the LDAP provided home path, so my question is: is there a way to have the LDAP user's home directory created locally when they log in instead of it trying to use /Volumes/[Servername]/...?

Thanks in advance

Update: Kamil's response seems to have helped make some progress, but instead of gdm reporting the home directory as being set to /Network/etc..., it's saying it's set to '' (null). I tried using

nss_map_attribute homeDirectory "/home/$username"

but this gave me the same error. Any ideas?

share|improve this question

1 Answer 1

The way we solved this is to add another attribute to LDAP, something like linuxHomeDirectory . Then you can create a mapping in ldap.conf:

nss_map_attribute homeDirectory linuxHomeDirectory

The for each user you set the attribute in LDAP to the path you want for their Linux home dir, such as /home/$username or whatnot.

If you have your home directories served from OS X server, you can mount those with an automounter in the /Volumes/$servername/$path hierarchy on Linux and then you don't need to do any LDAP attribute mangling.

More info: Here's an article how to extend the LDAP schema in OpenDirectory:

To populate the user attributes you can use the ldapadd and ldapmodify tools.

share|improve this answer
When I tried using nss_map_attribute homeDirectory linuxHomeDirectory, I then got another error saying that the home directory was set to '', so I'm guessing that linuxHomeDirectory isn't being set. How could I go about setting this? –  Steve Gattuso Sep 23 '09 at 12:59
As I mentioned, you need to extend your LDAP scheme with a new attribute and then set the attribute for each user. Sorry if it wasn't clear enough. –  Kamil Kisiel Sep 23 '09 at 17:12
How would I go about doing that, and by set the attribute for each user, do you mean go through and add something for each and every LDAP user? (That's around 700+ users in my case...) –  Steve Gattuso Sep 25 '09 at 14:08

Your Answer


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.