There are upcoming maintenance events which may impact our services. Learn more

Setup and secure a Cpanel server Print

  • 0

SSH
====

Add SSH user
-------------
Add user "sshadmin"
Assign root and wheel group
Assign password

Install Cpanel
---------------
mkdir /home/cpins
cd /home/cpins
wget http://layer1.cpanel.net/latest
sh latest

Install Fantastico
------------------
cd /usr/local/cpanel/whostmgr/docroot/cgi
wget http://www.netenberg.com/files/free/fantastico_whm_admin.tgz
tar -xzpf fantastico_whm_admin.tgz
rm -rf fantastico_whm_admin.tgz

Otheres
---------
Secure Tmp - /scripts/securetmp
Update Database - updatedb


IP Functions
=============
Show or Delete IP to make sure all IP is in
Add a New IP Address
Rebuild the IP Address Pool

Server Configuration
====================

Basic Cpanel Setup
------------------
Main Share IP - Server base IP
Server Contact Email
Default cPanel Theme - x
Default Home Directory - /home
Home Directory Prefix - home
Hostname
Primary Nameserver - Assign IP - Add A Record
Secondary Nameserver - Assign IP - Add A Record
[Save]

Server Time
------------
Set local server time

Tweak Settings
---------------
Under Display:
Domain Display - 300

Under Domain:
check - Prevent users from parking/adding on common internet domains

Under Mail:
check - BoxTrapper Spam Trap
Select - blackhole Default catch
check - Email users when they have reached 80% of their bandwidth
check - Horde Webmail
check - Include a list of Pop before SMTP senders in the X-PopBeforeSMTP header
check - Mailman
check - Neomail Webmail
60 - Number of minutes between mail server queue runs
uncheck - Prevent the user 'nobody' from sending out mail to remote addresses
check - SpamAssassin
check - SpamAssassin Spam Box delivery for messages marked as spam (user configurable)
check - SquirrelMail Webmail
150 - The maximum each domain can send out per hour
0 - The number of times users are allowed to check their mail using pop3 per hour
check - Track the origin of messages sent though the mail server by adding the X-Source

Under Notifications:
Uncheck - Disable Suspending accounts that exceed their bandwidth limit
check - Disk Space Usage Warnings
check - Email Box Usage Warnings

Under Stats Programs:
check - Analog Stats
check - Awstats Reverse Dns Resolution
check - Awstats Stats
check - Webalizer Stats

Under Stats and Logs:
check - Allow users to update Awstats from cPanel
check - Delete each domain's access logs after stats run
check - Exim Stats Daemon
uncheck - Keep Stats Log
uncheck - Keep log files at the end of the month

Under Status:
2 - The load average that will cause the server status to appear red

Under System:
check - Allow cPanel users to reset their password via email
check - Use jailshell as the default shell for all new accounts and modified accounts

Update Config
--------------
Under Cpanel:
Select - Automatic (RELEASE tree)


Networking Setup
=================
Hostname - Enter Hostname - [Change]
Nameserver IPs - Make sure is correct

Security
=========
Fix Insucure Permission Scripts
Wheel Group - make sure sshadmin is there
Shell Fork Bomb Protection - Enabled
Tweak Security
- Enable php open_basedir Protection
- Enable mod_userdir Protection
- Disable Compilers unprivileged users

Server Contacts
================
Change root Mail
Contact Manager - Assign Contact Manager

Service Configuration
======================
Enable SuExec
Disabled Anonymous Ftp
Service Manager - Select service to display

Cluster/Remote Access
========================
Generate a new Remote Access Key

Server Status
==============
Check Apache Ststus
Check CPU Usage
Check Server Information Match
Check Service status

Themes
=======
Add All WHM Themes
Add All Cpanel Themes

DNS Functions
=============
Add an A Record for Hostname
Edit DNS make sure all correct
Perform a DNS Cleanup
Synchronize DNS Records

Disk Drives
============
Format/Mount a new Hard Drive if needed

Software
=========
Update Server Software
Update System Software

cPanel
==========
Addon Module
- pro
- spamdconf
- clamavconnector
- modbandwidth
- modsecurity
- addonupdates
- cronconfig
Addon Scripts - All scripts
Upgrade to Latest Version

Add-ons
=========
Install Fantastico
Configure ClamAV Scanner - Scan Mail
Configure cPanel Cron Times

Remove LT info
===========
/etc/hosts
resolv.conf
Reverse DNS
httpd.conf

SSH Setup
========
cd /etc/ssh
nano sshd_config
- change port number
- change ssh verion to 2


Fix Open DNS
===========
Open named.conf with a text editor
Use a line "recursion no;" in the "options" section
If you need to enable recursion for your local network, you can use a "allow-recursion { ADD_LIST_OF_YOUR_IP_RANGES_HERE; }" line in the "options" section

Install rkhunter
============
mkdir /root/download/
cd /root/download/
wget http://nchc.dl.sourceforge.net/sourceforge/rkhunter/rkhunter-1.3.2.tar.gz
tar zxf rkhunter-1.3.2.tar.gz
cd rkhunter
./installer.sh

Run rkhunter
============
rkhunter -c


Was this answer helpful?

« Back