Created
November 23, 2010 08:19
-
-
Save natali/711451 to your computer and use it in GitHub Desktop.
Send email everytime someone login to root
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put in /root/.bashrc | |
echo 'ALERT - Root Shell Access on:' `date` `who | grep -v "203.24.76.33"` | mail -s "Alert: Root Access from `who | awk '{print $6}'| grep -v "203.24.76.33"`" [email protected] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Email are still sent when root/su-ing from valid IP 203.24.76.33. Should be using if .. fi but I don't know how :D