This article will provide a guide to clone CSF Firewall configuration to new cPanel server.
Goal: Install CSF firewall on new cPanel server using configuration settings from different cPanel server's existing CSF installation. This guide assumes user has root-level access to an existing cPanel VPS or cPanel Dedicated Server with CSF already installed and configured.
If you have multiple cPanel servers with CSF firewall setup and running, you may prefer to copy existing CSF configuration to newly-installed CSF on cPanel server. Benefits of copied CSF configuration to new installations would be environment consistency and time saved by eliminating manual configuration processes.
Clone CSF Firewall Configuration to New cPanel Server
To clone CSF Firewall configuration to new cPanel server from existing server, complete these steps below:
- From the terminal, login as root to the existing cPanel server with CSF (with configuration to copy) already running..
- Copy the following files from this server:
/etc/csf/csf.conf /etc/csf/csf.allow /etc/csf/csf.deny /etc/csf/csf.ignore /etc/csf/csf.fignore /etc/csf/csf.mignore /etc/csf/csf.pignore /etc/csf/csf.rignore /etc/csf/csf.signor /etc/csf/csf.suignore
- Login as root to the new cPanel server (where CSF configuration will be copied to).
- Upload all files from previous step to /etc/csf/ of new CSF server, overwriting the existing files in /etc/csf folder.
- On the same (new) server, issue the following command to restart CSF using the newly uploaded configuration files:
- CSF will now automatically be configured with settings cloned from previous installation (on existing cPanel server).
You have now completed your task of clone CSF firewall configuration to new cPanel server.