Go Back   Web Server Hosting Forum by BODHost > Support > Linux Server Hosting
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 10-02-08, 21:29
BOD Member
 
Join Date: Oct 2008
Posts: 30
Post Receive Root login alert on your email id

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.
__________________
Regards
George
Reply With Quote
  #2 (permalink)  
Old 10-03-08, 17:57
BOD Member
 
Join Date: Nov 2005
Posts: 206
Default

Thanks George,
It's really very helpful to enhance the security of the servers especially web server which exposes to the Internet and worldwide hackers, it is best to enable server to automatically send a notification email to predefined email address everytime someone logs in as root to the host.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 03:03.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.