📦 How to Backup & Restore CSF Configuration

Absolutely! Here’s a clear, step-by-step guide you can use or share:


CSF (ConfigServer Security & Firewall) stores its configuration and important allow/deny/ignore lists in /etc/csf. Backing these up ensures you can restore your firewall settings if needed.


🔹 Backup CSF Configuration

  1. Open a terminal and switch to the CSF directory: cd /etc/csf
  2. Create a compressed archive of your configuration and lists: tar cvfz csfbackup.tgz csf.conf csf.allow csf.deny csf.*ignore
    • csf.conf – main configuration file
    • csf.allow – manually allowed IPs
    • csf.deny – manually denied IPs
    • csf.*ignore – all ignore lists
  3. The file csfbackup.tgz will be created in /etc/csf. Keep this in a safe location (e.g., off-server backup or version control).

🔹 Restore CSF Configuration

  1. Go back to the CSF directory: cd /etc/csf
  2. Extract the backup archive: tar -zxvf csfbackup.tgz
  3. Restart CSF to apply restored settings: csf -r

That’s it! Your CSF configuration is now backed up or restored.


Scroll to Top