I want to be able to execute a custom script when pam does the authentication but I get an error out that I can't seem to pass:
Feb 20 17:39:47 DC03R07DS25-08 sockd[2874]: pam_exec(sockd:auth): send password to child
Feb 20 17:39:47 DC03R07DS25-08 sockd[2893]: pam_exec(sockd:auth): Calling /tmp/test.sh ...
Feb 20 17:39:47 DC03R07DS25-08 sockd[2874]: pam_exec(sockd:auth): waitpid returns with -1: No child processes
That's a very basic script that just prints out a 0
to allow everthing.
#!/bin/bash
# read the users password from stdin (pam_exec.so gives the provided password
# if invoked with expose_authtok)
read password
echo $password > /tmp/a.txt
exit 0
And here's my pam.d config:
auth required pam_exec.so debug expose_authtok /tmp/test.sh
account required pam_permit.so
I really need expose_authtok
so I can have access to the password in that script.
I am using Ubuntu 14.04.