This directory gives some pam-script examples. To use these scripts they must be placed in the directory indicated by "configure --sysconfdir", which is usually /etc/pam-script, and symbolic links need to be made to conform to the acceptable list of scripts that are invoked by pam-script: pam_script_auth pam_script_acct pam_script_passwd pam_script_ses_open pam_script_ses_close Note that each example requires log or data files that are readable and writeable at all levels of authorization, because not all services that use PAM are run as the root user (e.g. gnome-screensaver, etc.) and may not allow successful access otherwise. Therefore, be aware of the security implications though. logscript: Simply records the PAM_* environment variables and the pam_script.so arguments to /tmp/pam-script.log. It's useful to observe which stages are executed and by whom. However, if the script is modified to show PAM_AUTHTOK, this exposes the raw password text. The default behavior for pam-script is to fail if a needed script is missing for the corresponding module-type. To try out the pam-script.so module and the logscript program with the various module-types, it's easiest to edit the individual common service configuration files. Make the following symbolic links in /etc/pam-script/ ln -s logscript pam_script_auth ln -s logscript pam_script_acct ln -s logscript pam_script_passwd ln -s logscript pam_script_ses_open ln -s logscript pam_script_ses_close or do env PAMSCRIPTDIR=. ./pam_script -v -x -s all logscript For Ubuntu/Debian: cat >>/etc/pam.d/common-account <>/etc/pam.d/common-auth <>/etc/pam.d/common-password <>/etc/pam.d/common-session <> /etc/pam.d/system-auth <>/etc/pam.d/common-account <>/etc/pam.d/common-auth <> /etc/pam.d/system-auth <