ConfigServer Security & Firewall (CSF) is a powerful firewall configuration script designed to provide better security for servers while giving an advanced, easy-to-use interface for managing firewall settings. Additionally, Login Failure Daemon (LFD) works in conjunction with CSF to monitor login attempts and enforce security policies.

This tutorial will guide you through the process of downloading, installing, and configuring CSF and LDF using the WebHost Manager (WHM) interface. By following these steps, you'll be able to enhance the security of your server and manage firewall settings effectively.

Let's dive into the installation and configuration process.

 

1. Installation Process:

First, access your server via SSH. If you don't have SSH access, contact your hosting provider.

 
cd /tmp
rm -fv csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh
sh /etc/csf/remove_apf_bfd.sh

2. Post-Installation Configuration:

After a successful installation, follow these steps:

  • Log in to WHM (WebHost Manager) with your credentials.

  • Navigate to "Plugins" and then select "ConfigServer Security & Firewall."

  • Click on "Configure Firewall" and set the value of TESTING to 0.

  • For VPS packages, ensure MONOLITHIC_KERNEL is set to 1.

  • Scroll down and press "Change."

  • Click on "Restart csf+ldf."

  • Go back to the main "ConfigServer Security & Firewall" page.

  • Utilize the "Quick Allow" option to add trusted IP addresses to the Allow table, preventing potential blocks due to inadvertent login failures.

3. Troubleshooting:

Error: If you encounter an error related to missing iptables LKM ip_tables or lfd failures, follow these steps:

Solution:

  • In WHM, go to "ConfigServer Security & Firewall" and click on "Configure Firewall."
  • Find the MONOLITHIC_KERNEL setting and set its value to 1 to enable it.
  • Press "Change" and then "Restart csf+ldf" on the following page.

Alternatively, you can connect via SSH and edit the csf.conf file:

 
vi /etc/csf/csf.conf
  • Change MONOLITHIC_KERNEL = 0 to MONOLITHIC_KERNEL = 1.
  • Save the file and restart CSF with:
 
csf -r

4. Additional Notes:

  • The "Check Server Security" feature provides a baseline evaluation of the server's security and offers recommendations.
  • To uninstall CSF, utilize:
 
sh /etc/csf/uninstall.sh

Follow these steps carefully to ensure proper installation, configuration, and troubleshooting of CSF and LDF using the WHM interface. If you encounter any issues beyond what's mentioned here, consult the CSF documentation or seek further assistance from your hosting provider.

Was this answer helpful? 6 Users Found This Useful (7 Votes)