How to Enable cPanel/WHM Root and SSH Login Email Alerts

Secure your server by enable WHM root & SSH login email alerts , its very important security concern for server to protect the server from unknown login attempts. Every time you will notify via email with every login attempts.

We can do this by configuring the CSF so make sure you have CSF installed on the server, you can read the tutorial how to install CSF

Lets start ,
Step-1 : Login to WHM control panel and Go to:

Home >> Plugins >> ConfigServer Security & Firewall


Step-2: Change the value of “LF_CPANEL_ALERT” directive from ‘0‘ to ‘1‘.

Step-3: Restart the CSF.  its done..

You can Setup this as well as server command-line :

Step-1 :  login server with SSH  as root user & Open the CSF configuration file.


change the value of “LF_CPANEL_ALERT” directive from ‘0‘ to ‘1‘. & save it.  .

Step-2: Now Restart the CSF:

csf -r


 SSH Login Email Alerts:

Step-1: Login to your server as root user , run:

cd /root

vi .bashrc

Scroll to the end of the file then add the following:

echo 'ALERT - Root Shell Access (ServerName) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" [email protected]

Replace YourServerName with the handle for your actual server Replace [email protected] with your email address.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.