Depends on geoiplookup
/geoiplookup6
from Maxmind. See the
geoip-bin package on Debian and derivatives.
Depends on the GNU version of sed. If you’d like this to work on non-GNU systems, please contact me.
Example of usage: whitelist Finland, Jamaica and Taiwan:
/etc/hosts.deny
:
sshd : ALL : aclexec ! /opt/geoip-acl/geoip-acl FI,JM,TW %a
Depends on curl
.
To be run from cron (using >/dev/null 2>&1
or chronic).