CSF is a free firewall for Linux systems developed by a small foreign company. It works based on iptables and can effectively relieve server pressure. It has automatic shielding of brute-force password cracking IPs, management of open ports, immunity to lightweight DDos and CC, etc. Function, at the same time, it is also extremely easy to install and use. Our commonly used DA and CP panels also have graphical operation interfaces, and it also supports individual ordinary users to install and use in the LNMP environment.
InstallCSF
Perform the following steps to install:
rm -fv csf.tgz
wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh
Detect iptalbes module:
perl /etc/csf/csftest.pl
If APF was installed before, please uninstall it:
sh /etc/csf/remove_apf_bfd.sh
After execution, your CSF is installed. The above installation steps are applicable to LNMP environment and DA and CP panels.
[Note] LNMP environment may require dependent packages: yum install perl-libwww-perl perl iptables
From the official address: The following installation steps are from the official address: http://www.configserver.com/free /csf/install.txt
Configure CSF
Regarding configuring CSF, first of all, let's talk about the situation where we installed CSF configuration in the LNMP environment.
CSF configuration file address: /etc/csf/csf.conf
Whitelist: /etc/csf/csf.allow
Blacklist: /etc/csf/csf.deny
The main configuration information is in csf.conf, including opening commonly used ports. After each setting is completed, turn off the testing mode (TESTING = "0").
In WHM Under the /CP panel, log in to WHM, plug-ins, CSF Security & Firewall configuration related information.

Similar to the DA panel, log in directly to the DA administrator and select CSF Security & Firewall to enter the graphical interface settings.
Uninstall CSF
To uninstall CSF, please perform the following steps.
Uninstall in LNMP environment
cd /etc/csf
sh uninstall.sh
Uninstall under WHM/CP
cd /etc/csf
sh uninstall.sh
Uninstall under DA
cd /etc/csf
sh uninstall.sh
Please note that the above are all tests and commands under CentOS. Please refer to official information for detailed settings.
