LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   auto mail to root when a particular user logs in via ssh (https://www.linuxquestions.org/questions/linux-general-1/auto-mail-to-root-when-a-particular-user-logs-in-via-ssh-553975/)

tanveer 05-15-2007 02:17 AM

auto mail to root when a particular user logs in via ssh
 
Hi all,
I want to know if its possible to write a script, so that, if one particular user logs in using ssh then a mail
will be sent to the root account.

Thanks.

Tinkster 05-15-2007 07:35 PM

Not per "trigger". It would be easy enough, though, to have a script look at
the appropriate logfile (/var/log/auth.log in Slackware) and grep for the user
name and login-method in a timed loop, and send an e-Mail on success (of course,
you'll want to check the time-stamp, too, and keep it as a flag so you don't
get re-alerted for the same event every XX seconds :}).


Cheers,
Tink


All times are GMT -5. The time now is 07:19 AM.