|
|||
|
Root access alert email
I've had the server send me notification via email anytime root access to the server has occured. Since the move to CP11, I'm getting an email at 16 past midnight that root access has happened, but no IP address has been recorded, making me think it's something from a cron job... Here's an example:
ALERT-Root Shell Access on: Thu May 24 00:16:17 CDT 2007 While a normal email has: ALERT-Root Shell Access on: Thu May 24 08:05:39 CDT 2007 root pts/0 May 24 08:05 (adsl-70-244-110-121.dsl.ksc2mo.swbell.net) Obviously, I'd like to eliminate the first, since it makes me jump everytime i see it... |
|
|||
|
Here's the code, taken directly from the 'secure your server' sticky:
Code:
Server e-mail everytime someone logs in as root
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.
Having said that, when CP11 got updated, MailScanner choked, so I reinstalled using CS MailScanner package, so perhaps that's what's triggering it... I'll have to try restarting MailScanner and see if that does as suggested. And since you mention it, I've not been receiving (that I recall) the normal upcp emails... have to look into that as well
|
|
||||
|
Our MailScanner script uses the su to root functionality in init to setup the correct environment on restart which is why you'll see a login for root.
__________________
Jonathan Michaelson cPanel Forum Moderator Need your cPanel servers secured and tuned? cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf http://www.configserver.com |
|
|||
|
Quote:
Chirpy - Even though it only started since the upgrade to CP11 ?? Thanks Daniel |
![]() |
| Thread Tools | |
| Display Modes | |
|
|