How can I get cpanel to send email on root login

wonker

Active Member
Dec 5, 2007
32
6
58
Hello,

I've set up my servers to send me an e-mail when someone logs in as root to ssh, however I now would like them to send me an e-mail when someone logs in as root to whm.

Is this possible ? if so how can I do this ? I've searched the forum but have not found an answer yet ...

Thankyou !

I would actually like to be able to send each user an email when they log into cpanel but this is less important than the whm root or reseller login
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
Hello,

I've set up my servers to send me an e-mail when someone logs in as root to ssh, however I now would like them to send me an e-mail when someone logs in as root to whm.

Is this possible ? if so how can I do this ? I've searched the forum but have not found an answer yet ...

Thankyou !

I would actually like to be able to send each user an email when they log into cpanel but this is less important than the whm root or reseller login
Perhaps you could build a script that monitors /usr/local/cpanel/logs/access_log to determine when users login.
 
Last edited:

wonker

Active Member
Dec 5, 2007
32
6
58
Yes I could do this, however if I could add a script directly to cPanel Whm login this would be better ... to monitor /usr/local/cpanel/logs/access_log it would only tell me maybe 5 minutes afterwards and if someone managed to log in they could remove this easily ... the idea would be to get the email sent at the precise moment the person logs in ...

More and more systems provide an automatic e-mail system like this and I'm a bit surprised that there is not an option in cpanel to do this or a file that you could modify to add a simple mail command on login to whm ...
 

bluepine

Active Member
Dec 17, 2001
37
0
306
I am using ConfigServer's firewall, in particulare lfd; it tells you both failed and successfull login (I receive about 200 failed logins from China every day). The other nice thing, is that it can deny the IP after a number of failed logins.

Of course you have to tune it a bit since it has thousands of features you are probably not interested into, but I think it's worth a try, awesome product indeed.