Linux custom authentication with pam_exec

linux, pam

Solution

pam_exec will simply examine exit code of your script. If it is not equal to zero you will have denied authorization.

Problem

I'm having trouble finding an example on how to use `pam_exec` to run an external program that will authenticate users when they log in. I have the following in my `pam.d` file: ``` auth required pam_exec.so debug log=/tmp/aa /path/to/myscript ``` What should my script contain to allow or disallow authentication?

Original source