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
Done.
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.