Informational Website publish

Blog

News about our company, tutorials about IT and much more you will find in this page.

How to install CSF firewall on Linux Server

Janeiro 30th, 2018

The ConfigServer Security & Firewall is a popular open source Stateful Packet Inspection (SPI) firewall, Login/Intrusion Detection and Security application, compatible with most Linux servers.

CSF can be fully configured to block/restrict ports you don’t want open. CSF includes the Login Failure Daemon (LFD), which will scan log files and monitor failed login attempts, such as login attempts for FTP and E-Mail accounts, and it will block the IP according to the rules you have setup. CSF also offers Connection Limiting, Real Time Block Lists and Port Scan tracking and much more.

CSF can be easily managed from within its GUI, which is fully compatible with DirectAdmin, CPanel, and WebMin/Virtualmin.

Install Dependencies

Begin by installing the required dependencies for the CSF Firewall:

  • yum install perl-libwww-perl

Alternatively, libwww can be installed using CPAN:

  • perl -MCPAN -e ‘install Bundle::LWP’

Install CSF Firewall

  • $ cd /usr/src
  • rm -fv csf.tgz
  • wget https://download.configserver.com/csf.tgz
  • tar -xzf csf.tgz
  • cd csf
  • sh install.sh

Next, test whether you have the required iptables modules:

  • perl /usr/local/csf/bin/csftest.pl

To install or upgrade the csf webmin module:

Install the csf webmin module in:

Webmin > Webmin Configuration > Webmin Modules >
From local file > /usr/local/csf/csfwebmin.tgz > Install Module

Uninstall

  • cd /etc/csf
  • sh uninstall.sh