I’ve a debian system, when a user try to login, a pam module exec a bash script as root.
I need this script to know who is trying to login.
But the user isn’t already connected so basic command as users/w/who … doesn’t work here.
So is there a possibility to retrieve the username of a user trying to get logged ?
Thank you.
Cyrbil
You can also use
/etc/profileor/etc/bashrcto grab the user logging in, I typically have a small script that gets executed via/etc/bashrcthat gives me details about the user (who it is, connecting from what IP address etc).