Install libpam-geoip by entering the following commands in the terminal:
sudo apt update sudo apt install libpam-geoip
PAM module checking access of source IPs with a GeoIP database
This PAM module provides GeoIP checking for logins. The user can be allowed or denied based on the location of the originating IP address. This is similar to pam_access, but uses a GeoIP City database instead of host name / IP matching.