Cybersecurity is an important field of study. Making our server that runs web applications or client’s data safe is a big task. Here in this article, I will show you how to install and configure ConfigServer Security & Firewall (CSF).
Installing CSF
To begin, please note that Perl and libwww is a prerequisite to install CSF on any of the supported distributions (RHEL and CentOS, openSUSE, Debian, and Ubuntu).
# yum install perl-libwww-perl
# yum install libwww-perl
Download CSF
# cd /usr/src # wget https://download.configserver.com/csf.tgz
Extract the CSF tarball
# tar xzf csf.tgz # cd csf
Run the CSF Installation Script
# sh install.sh # perl /usr/local/csf/bin/csftest.pl
The Output will be Like:
Testing ip_tables/iptable_filter...OK Testing ipt_LOG...OK Testing ipt_multiport/xt_multiport...OK Testing ipt_REJECT...OK Testing ipt_state/xt_state...OK Testing ipt_limit/xt_limit...OK Testing ipt_recent...OK Testing xt_connlimit...OK Testing ipt_owner/xt_owner...OK Testing iptable_nat/ipt_REDIRECT...OK Testing iptable_nat/ipt_DNAT...OK RESULT: csf should function on this server
Disable Firewall and Configure CSF
# systemctl stop firewalld # systemctl disable firewalld
Now open /etc/csf/csf.conf (i.e: nano /etc/csf/csf.conf ) and change TESTING = “1” to TESTING = “0”
Restart and Test CSF
# systemctl restart {csf,lfd} # systemctl enable {csf,lfd} # systemctl is-active {csf,lfd}
Get more stuff
in your inbox
Subscribe to our newsletter and get interesting stuff and updates to your email inbox.