Email Alert on Root SSH Login

Login to your server as root user

vi /root/.bashrc

Add the following to the end of the file.

echo ‘ALERT - Root Shell Access on $hostname:’ `date` `who` |
mail -s “Alert: Root Access from `who | cut -d”(” -f2 | cut -d”)” -f1`” admin@serverbuddies.com

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.