ConfigServer Security and Firewall (CSF)
- Install CSF Firewall
- Install CSF firewall on Ubuntu Server
- Unban an IP from CSF Firewall
- Block Country in CSF firewall
- csf error path to iptables is either not set or incorrect
- How to run docker with csf firewall
How to use CSF Firewall
Firewall Configuration
- Disable IP Block Alerts in CSF Firewall
- Allow Passive FTP in Cpanel Server with CSF
- Enable UI in CSF Firewall on CentOS
Csf Requirments
On CentOS/RHEL
1 |
yum install -y perl perl-libwww-perl perl-Time-HiRes unzip bind-utils |
On Debian/Ubuntu
1 |
apt -y install libwww-perl |
Install CSF firewall
1 2 3 4 5 |
cd /usr/local/src wget https://download.configserver.com/csf.tgz tar -xzf csf.tgz cd csf sh install.sh |
Configure some basic settings for CSF
1 2 3 4 5 6 7 |
/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/SMTP_BLOCK\s*=.*/SMTP_BLOCK = \"1\"/g" /etc/csf/csf.conf /bin/sed -i "s/LF_GLOBAL\s*=.*$/LF_GLOBAL = \"1800\"/g" /etc/csf/csf.conf /bin/sed -i "s/LF_SCRIPT_ALERT\s*=.*$/LF_SCRIPT_ALERT = \"1\"/g" /etc/csf/csf.conf /bin/sed -i "s/PT_ALL_USERS\s*=.*$/PT_ALL_USERS = \"1\"/g" /etc/csf/csf.conf /bin/sed -i "s/TESTING = \"1\"/TESTING = \"0\"/g" /etc/csf/csf.conf |
Restart csf
1 |
csf -r |
Block an IP
1 |
csf -d IP_ADD |
Whitelist an IP
1 |
csf -a IP_ADD |