Skip to content

Instantly share code, notes, and snippets.

@stanfrbd
stanfrbd / sshfilter.sh
Created June 13, 2024 09:58
sshfilter.sh using ipinfo API
#!/bin/bash
# UPPERCASE space-separated country codes to ACCEPT
ALLOW_COUNTRIES="FR CH DE US"
LOGDENY_FACILITY="authpriv.notice"
TOKEN="token from ipinfo"
if [ $# -ne 1 ]; then
echo "Usage: `basename $0` <ip>" 1>&2
exit 0 # return true in case of config issue