Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I got a working setup with OpenLDAP (authentication and NFS mount options), NFS server, AutoFS (to mount the NFS homedir) and required PAM plugin. Everything works fine except that the mkhomedir PAM plugin doesn't work. In other word : the homedir isn't automatically created at the first login time, I got the following error :

Aug 26 11:21:55 SERVER1 sshd[3981]: pam_mkhomedir(sshd:session): unable to create directory /home/test2: No such file or directory

And nothing on the NFS/LDAP server.

My /etc/pam.d/common-session file : session required session required session optional session required skel=/etc/skel umask=0022

My /etc/auto.master file : /home ldap://,dc=XXXX,dc=local --timeout=5

Both files are on the client side.

Any idea ?


share|improve this question
up vote 2 down vote accepted

There are 2 approaches to this kind of setup:

  1. You have a shared home directory over nfs. In which case you use the AutoFS method to mount the home dir on access under /home (like you did with putting /home in auto.master)

  2. You have no shared home, and want a homedir for the user on each server he logins to. In this case you need pam_mkhomedir to create the directory upon first login.

It seems that you mixed both methods, by requesting autofs to mount /home/ and create a homedir on login.

You should choose one method and stick to it. If you want the homedir to be automounted, you'll have to create it with the user so it is available to him throught NFS.

You could try and merge the 2 methods by making /home automounted. Since that means you'll have to run AutoFS on /, perhaps it is better having /home/users automounted. Then you can have pam_mkhomedir create a homedir at /home/users/

share|improve this answer
Ok, so I will just create the folder after creating the account. – Henry-Nicolas Tourneur Aug 26 '09 at 10:05

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.