CSF firewall is famous free firewall solution that integrates with cPanel very well. It is the most user friendly (in my opinion) firewall and takes only two steps to install and configure.
Login to your server as root and run fullowing commands, you can copy paste all of them all togather.
rm -fv csf.tgz wget http://www.configserver.com/free/csf.tgz OR wget https://download.configserver.com/csf.tgz
tar -xzf csf.tgz cd csf sh install.sh
It will download and install ssh and you will get a message looking like this in the end.
*WARNING* TESTING mode is enabled – do not forget to disable it in the configuration
Next test if you have all the packages installed that are used by CSF, I have found that all the required packages are allready there and test shows success.
You will see output like below, ignore all messages and check the last line.
RESULT: csf should function on this server
Next login to whm and type “fire” in search box, then click “ConfigServer Security & Firewall”. Click firewall configuration button in “csf – ConfigServer Firewall” section. Change value of Testing field to “0”, scroll down to bottom and hit save.
Thats all, I will write about CSF other options that i set on shared cpanel servers.