CSF stands for Configserver Security and Firewall which is the most commonly used and popular firewall because it is very user friendly and it provides a cPanel interface to effectively make us of various features of it. CSF is most recommended in cPanel servers which are running without CSF.
NB: Installation of the CSF requires other firewalls completely if there are any.
- Download the package to the server which is available on the CSF website.
cd /usr/local/src wget <a href="http://www.configserver.com/free/csf.tgz" rel="nofollow">http://www.configserver.com/free/csf.tgz</a>
- Extract it.
tar -zxf csf.tgz cd csf
- Run the Install script.
For cPanel Servers :
For DirectAdmin Servers :
- Remove APF or IP ables Firewall
The existing IP tables firewall can removed using uninstall scripts located at /etc/csf. For example APF firewall and BFD on the server are removed by the following lines.
- Start the Firewall in Testing Mode
Start the firewall with the following command.
csf -s // start the firewall csf -r // restart the firewall csf -f // flush the rules or stop the firewall.
- Specify which ports you want to allow.
To open custom ports other than the default ones, you may have to edit the file /etc/csf/csf.conf and edit the lines with port numbers.
- Disable the Testing Mode and Start the Firewall
Firewall is running in testing mode by default settings. You may need to disable the firewall running in testing mode.
Look for the first line and set testing mode to “0”
TESTING = "0"
You may also set the following:
CT_LIMIT = "100" LF_ALERT_TO =(email id of the customer) SYNFLOOD =1
Now restart the firewall!
The configuration files regarding CSF in cPanle servers are pasted below.
/etc/csf/csf.conf CSF Firewall configuration file /etc/csf/csf.allow => Config file to allow IPs /etc/csf/csf.deny => Config file to deny IPs /etc/csf/ => Alert files with TXT extension are stored within this directory
To uninstall CSF, just run the uninstall script located at the installation directory.
That’s it.. 😉