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
- Open a terminal and switch to the CSF directory:
cd /etc/csf - Create a compressed archive of your configuration and lists:
tar cvfz csfbackup.tgz csf.conf csf.allow csf.deny csf.*ignorecsf.conf– main configuration filecsf.allow– manually allowed IPscsf.deny– manually denied IPscsf.*ignore– all ignore lists
- The file
csfbackup.tgzwill be created in/etc/csf. Keep this in a safe location (e.g., off-server backup or version control).
🔹 Restore CSF Configuration
- Go back to the CSF directory:
cd /etc/csf - Extract the backup archive:
tar -zxvf csfbackup.tgz - Restart CSF to apply restored settings:
csf -r
That’s it! Your CSF configuration is now backed up or restored.
