Install CSF firewall on Ubuntu Server

First, install libwww-perl package needed for CSF firewall

apt -y install libwww-perl

Install CSF with

cd /usr/local/src
wget https://download.configserver.com/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh

Change following settings in csf.conf file

Advertisement

/bin/sed -i "s/RESTRICT_SYSLOG\s*=.*$/RESTRICT_SYSLOG = \"3\"/g" /etc/csf/csf.conf
/bin/sed -i "s/SYSLOG_CHECK\s*=.*$/SYSLOG_CHECK = \"3600\"/g" /etc/csf/csf.conf
/bin/sed -i "s/TESTING = \"1\"/TESTING = \"0\"/g" /etc/csf/csf.conf

If you need GUI enabled, edit file

vi /etc/csf/csf.conf

Modify following settings

UI = "1"
UI_PORT = "8282"
UI_USER = "username"
UI_PASS = "password"
UI_ALLOW = "0"
Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement