Reputation: 61
I would like to block all ip addresses accessing my EC2 instance through RDP/SSH from all other countries except the local country. Is it possible to do this?
Upvotes: 4
Views: 2040
Reputation: 60094
EC2 security does not provide this functionality out of the box, but you can use other utilities to restrict access base on location.
you can try ssh-geoip-filter that work like charm all you need to specify allowed countries in the ssh filter.
# UPPERCASE space-separated country codes to ACCEPT
ALLOW_COUNTRIES='US DE IT AT CH NL PK ES US'
Another option is that you cam check pam_geoip-restrict-accounts-to-certain-citiescountrys-only
Upvotes: 1