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.*ignore
csf.conf
โ main configuration filecsf.allow
โ manually allowed IPscsf.deny
โ manually denied IPscsf.*ignore
โ all ignore lists
- 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
- 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.