I want to be able to echo a simple message in between password authentication and yubikey challenge response authentication when using sudo.
I've tried multiple ways to do it, such as pam_echo.so and pam_script.so but nothing seems to work. To my knowledge that is because sudo calls pam_authenticate with the pam_silent flag.
Here are some examples of what I tried:
auth required pam_echo.so file=/etc/security/sudo-msg.conf
auth required pam-script.so onsessionopen=/etc/security/sudo-msg.sh
No errors occured in my testing to my knowledge.
I've found this previous thread, but it doesn't answer my question, just says that "I can't do it". But there clearly is a way because the pam_yubico module has a debug parameter that prints stuff.
How can I echo my message aka how do I display stuff ignoring the PAM_SILENT flag?