ConfigServer Security & Firewall (CSF) is a suite of scripts providing:
- A straightforward SPI iptables firewall script
- A daemon process for login authentication checks
- A control panel configuration interface
- And much more!
This tutorial is designed for a server with the "CentOS 7 + DirectAdmin" template and is intended for self-managed virtual private servers.
Preliminary Requirements:
- "CentOS 7 + DirectAdmin" template installed on the server
- Fully updated server software: (yum update)
Step 1: CSF Installation
- Navigate to the
/usr/src
directory:
cd /usr/src
- Download the CSF package:
wget https://download.configserver.com/csf.tgz
- Extract the downloaded package:
tar -xzf csf.tgz
- Navigate to the CSF directory:
cd csf
- Run the installation script:
sh install.sh
Step 2: CSF Configuration
After installation, CSF starts in testing mode. Log in to your DirectAdmin instance at http://your-server-ip:2222
.
Select ConfigServer Firewall & Security.
You will see two notices that need attention. Select ConfigServer Firewall and then Firewall Configuration.
Turn off testing mode.
- Restrict syslog/rsyslog access.
- Press the Change button at the bottom of the page and then Restart csf+lfd.
You now have a fully working ConfigServer firewall. For more information, visit the CSF Readme page.