pam_exec.so Execute Commands on User Login

In addition to the normal pam_mkhomedir.so I wanted to create a directory for each user on an alternative disk. To do so I edited:

added the line below (just above the line: session optional pam_mkhomedir.so)

Then created the create_dir.sh file:

and added the following:

It is also possible to add extra options to pam_exec.so (man pam_exec) for debugging e.g.

 

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">