I've got a red hat box joined to a win 2k3 domain and I'm using pam_mkhomedir.so to create user's home directories on first login to the box.
extract from /etc/pam.d/sshd
session required pam_mkhomedir.so skel=/etc/skel umask=0022
The problem I have is that this only works if I switch SELINUX off (i.e. set enforcing to disabled ).
Unfortunately, the error messages are not very helpful. Extract from /var/log/secure below:
Mar 14 19:10:15 RHEL6 sshd: pam_mkhomedir(sshd:session): Executing mkhomedir_helper.
Mar 14 19:10:15 RHEL6 mkhomedir_helper: PAM unable to create directory /home/test: Permission denied
Mar 14 19:10:15 RHEL6 sshd: pam_mkhomedir(sshd:session): mkhomedir_helper returned 6