Root Breach Email Notification

If someone does happen to get root, be warned quickly by installing a detector and warning at your box. You will at least get the hackers/spammers IP address and be warned someone is in there.

Server e-mail every time someone logs in as root

To have the server e-mail you every time someone logs in as root, SSH into server and login as root.

At command prompt type:

nano .bash_profile

Scroll down to the end of the file and add the following line:

echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | awk '{print $6}'`" name@yourdomain.com

Hit CTRL+X press y and then enter to save the file.

Author: Christopher Smith

I managed websites.

Leave a Reply

Your email address will not be published. Required fields are marked *