View Single Post
  #7 (permalink)  
Old 06-09-2009, 06:42 AM
nileshparmar's Avatar
nileshparmar nileshparmar is offline
Registered User
 
Join Date: Nov 2007
Posts: 368
nileshparmar is an unknown quantity at this point
Arrow

after lot of googling i got below

& its really doing great job

Code:
So lets get started!

1. Login to your server and su to root, I know the irony!

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

Now logout of SSH, close the connection and log back in! You should receive an email address of the root login alert a few minutes afterwards.
__________________
Sincerely!
Nilesh
Reply With Quote