0

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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Kittystone
  • 661
  • 3
  • 9
  • 28

1 Answers1

1

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.

MatsLindh
  • 49,529
  • 4
  • 53
  • 84
  • hmm... that sounds complicated , anything fast and easy to hook – Kittystone May 02 '17 at 15:27
  • It doesn't need to be, but there are varying solutions available. Check http://stackoverflow.com/questions/12523044/how-can-i-tail-a-log-file-in-python – MatsLindh May 03 '17 at 05:51