Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have setup pam_mkhomedir so that users home directories are automatically created at their first login. But I also want to create directories on a different place like this.

  • /home/username (pam_mkhomedir can make this directory)
  • /scratch/username

As far as I know, having a script in /etc/profile.d can't manage this because normal users don't have write-permission on /scratch.

Does anyone know how to make this happen?

Thanks in advance.

share|improve this question
    
An suid script in /etc/profile? –  Zoredache Mar 12 '13 at 23:13
    
Thank you! I'll go with pam_exec. –  Koji Mar 13 '13 at 0:07

1 Answer 1

up vote 1 down vote accepted

You can use pam_exec to trigger a script at login. In the script you can create the /scratch/username folder if it does not exist.

share|improve this answer
    
Thank you! pam_exec works perfectly. –  Koji Mar 13 '13 at 0:06

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.