I'm trying to block some asian countries from accessing my server via FTP (Pure-FTPd), since most of the time they login on it is to try dictionary passwords, or to hack somebody.
I've already tried editing /etc/hosts.deny and using "Host Access Control" on WHM denying my IP address on both for the FTP service, but I was still able to connect to the FTP port as usual.
I'm using CSF which already have an option to block IP ranges by countries, but it blocks them completely which is not what I'm looking for; also when I choose too many countries, it exceeds the iptables rules limit and I'm pretty sure it will slow things down a lot.
I've also thought about doing it with GeoIP like some users did with Bind (different zones per country), but I would need to compile my own Pure-FTPd with a patch to do so. I'm not that good at programming, and also cPanel will step over it everytime it updates so perhaps it's not that good idea either.
¿Is there a simple way to avoid the users from a country (eg. China) to login via FTP without using iptables?
Here's the IP ranges list: http://www.ipdeny.com/ipblocks/data/countries/cn.zone
I've already tried editing /etc/hosts.deny and using "Host Access Control" on WHM denying my IP address on both for the FTP service, but I was still able to connect to the FTP port as usual.
I'm using CSF which already have an option to block IP ranges by countries, but it blocks them completely which is not what I'm looking for; also when I choose too many countries, it exceeds the iptables rules limit and I'm pretty sure it will slow things down a lot.
I've also thought about doing it with GeoIP like some users did with Bind (different zones per country), but I would need to compile my own Pure-FTPd with a patch to do so. I'm not that good at programming, and also cPanel will step over it everytime it updates so perhaps it's not that good idea either.
¿Is there a simple way to avoid the users from a country (eg. China) to login via FTP without using iptables?
Here's the IP ranges list: http://www.ipdeny.com/ipblocks/data/countries/cn.zone