Sunday, December 18, 2011

Server e-mail everytime someone logs in as root

** < Just follow the steps given below >**--   :--

-----------------

To have the server e-mail you everytime someone logs in as root, SSH into server and login as root.
---------------------------------
At command prompt type: pico .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}'`" your@email.com
---------------------------------
Save and exit
*-------*******------------******---*****-----------*******-------*

No comments:

Post a Comment