If you want to get notified whenever someone tries to login onto your linux server,you can do it by following the steps shown below.

 [root@server~]# vim /root/.bashrc
 echo ‘ALERT – Root Shell Access MY  SERVER on:’ `date` `who` | mail -s “Alert: Root Access from `who | cut -d”(” -f2 | cut -d”)” -f1`” email@domain.com

Posted in: Linux.
Last Modified: October 11, 2013

Leave a reply