This tutorial is by no means a how-to on how to completely secure a server running cPanel & Linux - it only covers the basics...
First Steps.
Change the following default settings in WHM...
Goto Server Setup > Tweak Settings
Under
Domains
Prevent users from parking/adding on common internet domains. (ie hotmail.com, aol.com)
Under
Mail
Attempt to prevent pop3 connection floods
Default catch-all/default address behavior for new accounts - blackhole
Under
System
Use jailshell as the default shell for all new accounts and modified accounts
Goto Server Setup > Tweak Security
Enable
php open_basedir Protection
Enable
mod_userdir Protection
Disable Compilers for unprivileged users.
Goto Server Setup > Manage Wheel Group Users
Remove all users except for root and your main account from the wheel group.
Goto Server Setup > Shell Fork Bomb Protection
Enable
Shell Fork Bomb/Memory Protection
Goto Service Configuration > FTP Configuration
Disable Anonymous FTP
Goto Account Functions > Manage Shell Access
Disable Shell Access for all users (except yourself)
Goto Mysql > MySQL Root Password
Change root password for MySQL
The next steps presume that you have root access and SSH access...
Firstly you need to log into your server via SSH, a good windows client for this is PUTTY (which you can download from here
http://www.chiark.greenend.org.uk/~s.../download.html )
Once you have followed the PUTTY instructions and logged into your server:
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.
make sure you change the
your@email.com to your email address (not a server email address) this will then automatically email you should someone log into your server as root via SSH.
