#1 (permalink)  
Old 06-03-2009, 07:33 AM
nileshparmar's Avatar
Registered User
 
Join Date: Nov 2007
Posts: 375
nileshparmar is an unknown quantity at this point
Arrow E-mail Alert on Root SSH Login

Want to be notified instantly when someone logs into my server as root
With date time & local IP address
Is it possible to do this thing?
__________________
Sincerely!
Nilesh

Last edited by nileshparmar; 06-03-2009 at 07:48 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-03-2009, 09:29 AM
cPanel Partner NOC
 
Join Date: Jul 2005
Location: New Jersey, USA
Posts: 387
PlatinumServerM is on a distinguished road
Sure you can do this /root/.bashrc
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-03-2009, 11:42 AM
Registered User
 
Join Date: Jul 2006
Posts: 204
ChrisRHS is on a distinguished road
Take a look at my blog post:
SolidServers.ca » Blog Archive » More SSH security
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-06-2009, 05:32 AM
nileshparmar's Avatar
Registered User
 
Join Date: Nov 2007
Posts: 375
nileshparmar is an unknown quantity at this point
Arrow

Quote:
Originally Posted by PlatinumServerM View Post
Sure you can do this /root/.bashrc
what can i do to this /root/.bashrc
__________________
Sincerely!
Nilesh
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-06-2009, 05:53 AM
Infopro's Avatar
Forum Moderator
 
Join Date: May 2003
Location: Pennsylvania
Posts: 3,762
Infopro is on a distinguished road
Lightbulb

LFD does this. You might want to take a look at your CSF configuration. This is covered there along with email alerts for many other things as well.

No need to edit that file, IMHO..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 06-06-2009, 06:43 AM
nileshparmar's Avatar
Registered User
 
Join Date: Nov 2007
Posts: 375
nileshparmar is an unknown quantity at this point
Arrow

Quote:
Originally Posted by Infopro View Post
LFD does this. You might want to take a look at your CSF configuration. This is covered there along with email alerts for many other things as well.

No need to edit that file, IMHO..
what exact to look in CSF configuration
__________________
Sincerely!
Nilesh
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 06-09-2009, 06:42 AM
nileshparmar's Avatar
Registered User
 
Join Date: Nov 2007
Posts: 375
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Root access alert email Lyttek cPanel and WHM Discussions 7 06-03-2007 03:28 AM
SSH root login DENIED Lestat cPanel and WHM Discussions 6 11-18-2006 01:29 AM
How do I only allow SFTP access and restrict just root to certain IP's for SSH login? Mac Write cPanel and WHM Discussions 2 09-29-2006 01:27 PM
Mail alert when someone logs into your SSH d4rkl0rd cPanel and WHM Discussions 0 07-10-2004 02:22 PM
WHM root login lost - ssh still OK dennism cPanel and WHM Discussions 4 06-23-2004 05:24 AM


All times are GMT -5. The time now is 09:02 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© cPanel Inc