The first step would be to download CSF from their site using wget. The output should be something similar to this:
[root@web ~]# wget http://www.configserver.com/free/csf.tgz
It’s a small file so the download should finish immediately. Next we’ll extract the archive using tar, change directory and install CSF on CentOS :
[root@web ~]# tar -xzf csf.tgz
[root@web ~]# cd csf
[root@web csf]# sh install.sh
We will edit the configuration file located under /etc/csf/csf.conf and add your SSH port to the exceptions list(In case we’re using something else than the default 22). Once that’s done and we’ve went through all the options in the configuration file we can adjust the following variable:
TESTING = “0”
and restart the service using csf -r. This would disable testing mode and the firewall is ready for use.
There are many options and we can also configure alerts and messages content that we receive in your email by altering the template files that exist within /etc/csf/ folder.