Root Login Detector


Posted:   |  More posts about System Administration

Getting an email alert when an account is logged in is really simple to set up.

To add a login detector to an account just append the following to the end of the user's (usually root) ~/.bash_profile and you can have an email alert sent to the desired address.

echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | awk '{print $6}'`" alerts@example.com
Comments powered by Disqus
Contents © 2015 Daniel Devine - Nikola Powered - Flattr Me! Flattr this Source