CSF Firewall Whitelist an IP Address IN CLI

ConfigServer Firewall (CSF) is a powerful software firewall. All managed servers at Greens247 have cPanel and CSF preinstalled. Sometimes CSF can interfere with your server operations because of its default strict policies. You may need to whitelist an IP that you trust to avoid it from getting blocked. This article will explain how to whitelist an IP address using CLI in terminal. If you are for looking to whitelist an IP address in CSF firewall for cpanel using the graphical interface plugin, this is not the right article for you.
Whitelisting an IP address in CSF firewall will prevent the cPanel server from blocking the IP addresses that you trust. Please use this with caution. If a ddos or a bruteforce attack was launched on your server from a whitelisted IP, the server will ignore the attack and will not report it to you.
Prerequisite:

In order to perform this task, you need to have root access to the server. You will need a terminal text editor like vi, vim, nano and so on.

Procedures:

Login to the server terminal.

Using your favorite text editor open the following file using this command

Add your IP address to the list, save the file and exit the text editor.

For the changes to take effect, you need to reload the firewall using this command.

If your IP address was previously blocked permanently it should be in "csf.deny", so make sure you remove it in order to avoid conflict.

If you find your IP there you need to remove the entire line, save and exit the text editor.

Reload the csf firewall

You have successfully whitelisted your IP address in CSF firewall using CLI in terminal.

Was this article helpful?

0 out of 0 liked this article

Still need help? Message Us