Installing CSF Firewall

Install/update firewall (Recommended CSF)

  1. Download the package here

#cd /usr/local/src
#wget http://www.configserver.com/free/csf.tgz
#tar -zxf csf.tar.gz
#cd /csf
#sh install.sh

# vi /etc/csf/csf.conf
Find TCP
# Allow incoming TCP ports
TCP_IN = “20,21,25,53,80,110,143,443,465,953,993,995,2082,2083,2086,2087,2095,  2096,8090,49226,26,512:65535,5666,3306,3333”
# Allow outgoing TCP ports
TCP_OUT = “20,21,25,37,43,53,80,110,113,443,587,873,953,2087,2089,2703,8090,512:65535”
Then add your ip and client ip in the two files.
#Vi /etc/csf/csf.allow
#Vi /etc/csf/csf.ignore
How Remove the CSF Firewall
Just run the uninstall script located at /etc/csf/ directory
#cd  /etc/csf/
#sh uninstall.sh

Related posts

Leave a Comment