The problem I am trying to solve is that I want to know if a certain PAM config file is being used or not. The latest version of IBM MQ (V8) provides a PAM file /etc/pam.d/ibmmq. We're troubleshooting authtentication problems and I want to know if this file is being used or not.

I thought I should be able to use pam_echo for this but I misunderstood that module's purpose. pam_echo will display the contents of the file specified to the user. This is not what I want I want to somehow log that a module is being called.


I found the following solution that works but I'm open for other suggestions.

pam_exec can be used to call external commands. I'm using a very simple form to print a message to a log file.

auth    optional pam_exec.so log=/var/tmp/ibmmq.log /usr/bin/echo "ibmmq auth"
auth    include system-auth
account optional pam_exec.so log=/var/tmp/ibmmq.log /usr/bin/echo "ibmmq account"
account include system-auth

Note that the log= option needs to be specified before the command and that you need to fully qualify the paths.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.