Sunday, 18 September 2011

Root Login Alert

If you want to enable root login alert for your server then you can do the following procedure.

So lets get started!


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@yourdomain.com

Replace
YourServerName with the handle for your actual server
Replace
you@yourdomain.com with your actual email address

5. Crtl + X then Y

No comments: