How to install CSF firewall on CentOS

Categories

How to install CSF firewall on CentOS

You are here:

Introduction

CSF – Config Server Firewall is a free,  flexible and easy to configure firewall compatible with most distributions of Linux. In this short guide we will provide the information how to install and enable it on CentOS.

Install the dependencies

dnf install perl-libwww-perl perl-Math-BigInt wget -y

 

Download CSF files and extract them

cd /usr/src
wget https://download.configserver.com/csf.tgz

tar xzf csf.tgz
cd csf

 

Run the installation script

sh install.sh

At this point CSF firewall has been installed and it is ready to use on your server

 

Enable and start csf and lfd services

systemctl enable csf && systemctl enable lfd
systemctl start csf && systemctl restart lfd

 

Check if both services have started with no issues

systemctl status csf
systemctl status lfd
csf -e

 

If you want to uninstall csf from your server run the following:

cd /etc/csf
sh uninstall.sh

 

 

Previous How to Find All Clients Connected to HTTP or HTTPS Ports
Next Howto check if ports are open using nmap and netcat
Table of Contents