Run PAM script only when logging in using su

68 views Asked by At

I have a script in /usr/local/bin that I reference in /etc/pam.d/su using:

session  optional  pam_exec.so  stdout  /usr/local/bin/script.sh

It runs as expected when I login to user from root using su - user, but it also executes when I exit or logout from user. How do I stop it from running when logging out?

0

There are 0 answers