To implement this:
-
Save this script as "/usr/local/sbin/ssh-country-check" with your changed config
-
Add this to /etc/ssh/sshd_config: ForceCommand /usr/local/sbin/ssh-country-check
-
Make the script executable: chmod +x /usr/local/sbin/ssh-country-check
-
Restart SSH service: systemctl restart sshd