I have a ubuntu server where a number of users login, i need to monitor who logs in. I am thinking of a pythonic way or anything better because i need to send the notification to slack.
So what i meant is , a python script sends notification to slack only when a user successfully logs in. I can write the slack integration but i am not sure how the script will be triggered on login?
Ubuntu will keep track of any authentication (either login or sudo) attempts through /var/log/auth.log. Keep track of that file (or read up on how log entries are written to it) and you can then send notification to any other channel as the entries arrive.
How to run a python script and see who logged in