Folder permissions when using /etc/skel and pam

Posted by rothgar on Server Fault See other posts from Server Fault or by rothgar
Published on 2012-06-08T23:10:37Z Indexed on 2012/06/09 4:42 UTC
Read the original article Hit count: 472

Filed under:
|

I have a Red Hat 5.8 server that is bound to active directory and users are authenticated via active directory when they log in via sftp. User home folders are created during login using /etc/pam.d/system-auth. The specific line that creates the home folder is

session optional pam_mkhomedir.so skel=/etc/skel/ umask=0066

This correctly gives home folders 711 permissions so no one else can read their directories. The problem is, the pam_mkhomedir.so also modifies permissions on all folders/files inside the /etc/skel folder which I don't want. There is a public_html folder (for apache) which needs to have 755 permissions so users can create web pages.

Is there a way for me to either a) stop pam_mkhomedir.so from recursively changing all the file permissions or b) create a script that creates the public_html folder after skel is copied and to set the correct permissions?

© Server Fault or respective owner

Related posts about linux

Related posts about active-directory