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'm trying to setup linux login via an LDAP server.

I have everything working except setting the user's home directory. There is no parameter in the LDAP database that I can map to the homeDirectory attribute and I don't have the power to change the databse.

Is there any way I can configure it to use something like /home/$UID, where $UID is the username they're using to login/that's coming from the LDAP attribute uid?

Thanks.

share|improve this question
add comment

3 Answers

One option is to use something like nsscache and then have a script that runs on the cached passwd database and modifies the user home directory attributes.

share|improve this answer
    
Thanks - I'm going to do that for now, but it feels a little hackish. –  Tom Kiley Jan 22 '10 at 15:10
add comment

Being Linux, you can try using PAM:

In /etc/pam.d/common-session put:

session required      pam_mkhomedir.so   skel=/etc/skel umask=0002

And fill in /etc/skel the home template that you want for users.

At first login, the home will be created.

You will have to deal with user deletion... their homes will remain on servers.

share|improve this answer
add comment

Put

map passwd homeDirectory "/home/$uid"

to /etc/nslcd.conf (on Debian systems, on other systems it might be /etc/(ldap)/ldap.conf)

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.