To back up and restore CSF configuration in WHM (Web Host Manager), you can do so directly from the WHM interface. Backing up and restoring the CSF (ConfigServer Security & Firewall) configuration is essential for maintaining the security settings of your server. Regular backups ensure that in case of an accidental misconfiguration, system update, or server migration, you can quickly restore your firewall to a known working state. This guide will walk you through the steps to efficiently back up and restore your CSF configuration, whether you’re managing it via SSH or using WHM (Web Host Manager). By following these steps, you can safeguard your server’s security settings and ensure minimal downtime in case of any changes or issues.
Here’s how:
Backup CSF Firewall Configuration in WHM
Log into WHM
Open your WHM dashboard by logging into https://your-server-ip:2087
.
Navigate to the CSF Interface
In the left-hand menu or search bar, type “ConfigServer Security & Firewall” and click on it to open the CSF management panel.
Backup Configuration Files
In the CSF management interface:
- Scroll down and look for the “csf – ConfigServer Firewall” section.
- Click on the “Firewall profiles” option.
- locate Backup csf.conf and enter the backup file date or name in Entry
- Then click the Create backup option to generate backup of CSF configuration
- This will allow you to backup up your
csf.conf
and other related CSF configuration files. You can Create backup of the configuration backup file
Restore CSF Configuration in WHM
Restore Configuration Files
- In the CSF management interface:
- Scroll down and look for the “csf – ConfigServer Firewall” section.
- Click on the “Firewall profiles” option.
- Locate Restore Backup Of csf.conf to restore CSF Configuration
- Select the backup required to be restored and click Restore Backup.
- Restart CSF and LFD
After restore CSF Configuration, you must restart the firewall and login failure daemon:
- In the CSF interface, scroll down and click on “Restart CSF+LFD” to apply the changes.
Alternative Backup via File Manager in WHM
Open File Manager
You can also back up the CSF configuration using File Manager in WHM.
- Navigate to File Manager.
- Go to the
/etc/csf/
directory and download the configuration files (likecsf.conf
).
Restore via File Manager
To restore, upload the backed-up files to the same directory (/etc/csf/
) using File Manager, then restart CSF and LFD as mentioned above.
This method simplifies the backup and restoration of CSF firewall settings without needing to use the command line.