How to create home directory on LDAP login

  • 7008559
  • 11-May-2011
  • 22-May-2013

Environment

Novell Open Enterprise Server 2 Linux Support Pack 3
OES2 SP3
SUSE Linux Enterprise Server
SLES 10
SLES 11

Situation

How to create user home directories on ldap login.
 
How to dynamically create user home directories.

Resolution

In the /etc/pam.d/common-auth add
session required pam_mkhomedir.so skel=/etc/skel/ umask=0022
 
Modify the umask as desired
example: only the user can read, write and execute
umask=0077

Additional Information

This solution does not apply to DSfW servers.  The ldap mapping on a DSfW server is mSDS:HomeDirectory, not unixHomeDirectory.  The mapping can not be changed with out breaking DSfW.