Monday 31 October 2011

root access by email

root access by email

I am looking for something that will notify me by email everytime someone login as root. I have found this script to put in bash file of root. But it doesn't send the IP of person which is logged in as root.
Even that I have read, that there is other ways where can someone pass through to root access and script won't send an email.

Is there more relaible way to get notification by email, tha this below?

1. Login to your server and su to root!

2. cd /root

3. pico .bashrc

4. Scroll to the end of the file then add the following:
echo 'ALERT - Root Shell Access (YourserverName) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" you(at)yourdomain.com

No comments:

Post a Comment