Step-by-step guide to installing and configuring CSF via SSH on Rocky Linux, including essential commands to secure your server.
π Server security β’ β‘ SSH commands β’ π οΈ Easy setup
If you're new to CSF (Config Server Firewall), or even if youβve used it before, itβs always useful to have a quick reference for installation and SSH commands when managing a server.
This guide covers installing CSF on Rocky Linux (also compatible with CentOS), basic configuration steps, and a handy command cheat sheet for everyday firewall management.
Note: As of August 2025, CSF development has been discontinued. It can still be used, but it no longer receives updates, which may introduce future security risks.
To connect to your server via SSH, youβll need an SSH client such as PuTTY or a terminal.
Install wget:
yum -y install wget
Go to directory:
cd /usr/src/
Download CSF:
wget https://download.configserver.com/csf.tgz
Extract and install:
tar -xzf csf.tgzcd csfsh install.sh
Install dependencies:
yum install perl-libwww-perl perl-LWP-Protocol-https perl-GDGraph
Run test:
perl /usr/local/csf/bin/csftest.pl
Edit config:
nano csf.conf
Change:
TESTING=1 β TESTING=0
Restart:
csf -r
| Command | Description |
|---|---|
| csf -e | Enable CSF |
| csf -x | Disable CSF |
| csf -s | Start firewall |
| csf -f | Flush rules |
| csf -r | Restart firewall |
| csf -a IP | Allow IP |
| csf -d IP | Block IP |
| csf -dr IP | Unblock IP |
| csf -td IP | Temporary block |
| csf -tr IP | Remove temp rule |
| csf -t | View temp rules |
| csf -g IP | Search rules |
CSF is a powerful firewall tool for managing server security through SSH. Even though it is no longer actively maintained, it is still widely used for controlling access and blocking malicious traffic.