Introduction

Config Server Firewall (CSF) is a popular and powerful firewall configuration script designed to provide better security for Linux servers. This tutorial will guide you through the process of installing and configuring CSF on Rocky Linux 9.

Prerequisites

Before you begin, ensure you have:

  1. A Rocky Linux 9 server
  2. SSH access to the server (optional)
  3. Root or sudo privileges

Step 1: Install CSF

Install CSF using the following commands:

sudo dnf install -y wget perl unzip
wget https://download.configserver.com/csf.tgz
sudo tar -xzf csf.tgz
cd csf
sudo sh install.sh

Step 2: Configure CSF

Edit the CSF configuration file to customize the settings:

sudo nano /etc/csf/csf.conf

Make any necessary changes to the configuration file, such as opening specific ports or enabling certain features.

Step 3: Start CSF

Start the CSF firewall:

sudo csf -r

Step 4: Enable CSF at Boot

To ensure CSF starts automatically at boot, enable the CSF service:

sudo systemctl enable csf

Step 5: Check CSF Status

Check the status of CSF to ensure it is running:

sudo csf -s

Conclusion

Congratulations! You have successfully installed and configured Config Server Firewall (CSF) on Rocky Linux 9. You can now use CSF to enhance the security of your server.

Was this answer helpful? 0 Users Found This Useful (0 Votes)