How to Install CSF and LDF Firewall on a Linux server and manage from WHM/ cPanel
We recommend you to install CSF (ConfigureServer Firewall) and LDF (Login Failure Daemon) to manage and improve your Linux server security and firewall. Below are the some steps about the installation of CSF. It is very simple process to setup and mange CSF and LDF on a Linux server / cPanel.
To start installation please logon to your Linux server via SSH with root user and follow the steps below:
# cd ~
# wget https://download.configserver.com/csf.tgz
# tar xfz csf.tgz
Change Directory to csf:
# cd csf
Run the installer:
# sh install.sh
The CSF installer will create configuration file and add all required services/ cPanel to allow list by default.
Please disable testing mode by changing the value to TESTING =”0” main CSF configuration file using your favorite editor (vi or nano)
# nano /etc/csf/csf.conf
TESTING = “1” è TESTING = “0”
Please note: LDF will not start until you disable testing by changing value to TESTING = “0”
When done, restart CSF:
# csf -r
CSF firewall is installed and running on the server.
You can review firewall configurations and apply changes in CSF firewall configuration by editing /etc/csf/csf.conf in your favorite editor
# nano /etc/csf/csf.conf
How to manage CSF and LDF firewall in WHM/ cPanel?
We can manage our firewall in WHM on below Link,
Homeè Plugins è ConfigServer Security & Firewall
If you have APF + BFD you will need to disable it, you can use the following to do so:
# sh disable_apf_bfd.sh
Please note: by default CSF opens the standard cPanel ports.
How to remove CSF and LDF firewall from Linux server?
Removing csf and lfd is very simple task. You have to login to your server via ssh with root user privileges and execute following commands:
# cd /etc/csf
# sh uninstall.sh