If you would like to receive mail alert after any one logn into your server as root user then follow the following steps.
First login into server as root and open the file .bash_profile in your favorite editor and then add the following line in the end of the file .bash_profile
Quote:
vi .bash_profile
echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | awk '{print $6}'`" your@email.com
|
You will receive mail at
your@email.com with all information like ip address,login time etc.