Email notification when cPanel user logs in?

Mash962

Registered
Jan 16, 2018
2
0
1
Sri Lanka
cPanel Access Level
Website Owner
Hello.
Is there any way to get email notification when a user logged to cPanel? I have installed ConfigServer Security & Firewall(csf) to the WHM. Is there any feature in firewall to achieve this target?

Thanks.
 

rpvw

Well-Known Member
Jul 18, 2013
1,101
459
113
UK
cPanel Access Level
Root Administrator
Yes you can:

In CSF configuration look for LF_CPANEL_ALERT and switch this ON
Send an email alert if anyone accesses WHM/cPanel via an account listed in
LF_CPANEL_ALERT_USERS. An IP address will be reported again 1 hour after the
last tracked access (or if lfd is restarted)
 
  • Like
Reactions: LMG and cPWilliamL

cPWilliamL

cP Technical Analyst II
Staff member
May 15, 2017
258
30
103
America
cPanel Access Level
Root Administrator

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,222
463
Hello @jmginer,

In order to use this setting, cPHulk must be enabled in WHM's cPHulk Brute Force Protection interface (WHM >> Security Center >> cPHulk Brute Force Protection).

Thank you.
 

jmginer

Well-Known Member
Jul 26, 2006
150
4
168
Alicante
cPanel Access Level
Root Administrator
Hello @jmginer,

In order to use this setting, cPHulk must be enabled in WHM's cPHulk Brute Force Protection interface (WHM >> Security Center >> cPHulk Brute Force Protection).

Thank you.
Thanks! I've enabled cphulk, but the option is disabled by default.
It's possible to enable on all cPanel accounts? and enable by default for new created accounts?

Thanks!

- Removed -
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,222
463
Hello @jmginer,

You'd need to create a bash command that loops the following cPanel API 2 function on all existing accounts:

cPanel API 2 Functions - CustInfo::savecontactinfo - Developer Documentation - cPanel Documentation

For new accounts, you could setup a post account creation hook that automatically executes the above cPanel API 2 function. The command for a single account looks like this:

Code:
cpapi2 --user=username123 CustInfo savecontactinfo notify_account_login=1
Additionally, I encourage you to vote for the following feature request if you'd like to see a way to set the defaults through WHM:

Ability to set defaults for cPanel user notifications

Thank you.