How to block a Country using CSF Firewall

How to block a Country using CSF Firewall

 

If you don’t have a need for certain international visitors to your Linux server, its easy to block them out!  First, you’ll need to make sure that CSF is installed.  You can follow this guide on installing csf to get this accomplished.  Once that’s done, read on to block access from Russia, China, etc..

To block country from “CSF” firewall, for this you need to login shell, if you re not using WHM..etc.

Now that CSF is installed, open up your config file (/etc/csf/csf.conf) and search for the country codes section.  It starts on line 570 in the current (i am using the v8.16) version.

You’ll see the following: