Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
xKhronoz authored Apr 11, 2024
1 parent e65087e commit bcd63c8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To update your GeoIP database you need an free MaxMind License Key - register an
with MaxMind, see [MaxMind's docs on geoipupdate](https://dev.maxmind.com/geoip/updating-databases).

You would also need to install the latest `geoipupdate` version,
you can find the lastest version & installation instruction on [MaxMind's `geoipupdate` repo](https://github.com/maxmind/geoipupdate).
you can find the lastest version & installation instruction on [MaxMind's geoipupdate repo](https://github.com/maxmind/geoipupdate).

From the docs, you will also be able to follow the instruction to download a sample configuration file to be put at `/etc/GeoIP.conf`.

Expand Down Expand Up @@ -53,15 +53,15 @@ $ sudo apt install libmaxminddb0 libmaxminddb-dev mmdb-bin geoipupdate
2. Clone the repo:

```bash
$ git clone https://github.com/xKhronoz/SSHD-GeoIP-Filter.git
$ git clone https://github.com/xKhronoz/SSH-GeoIP-Filter.git
```

3. Copy the script to `/usr/local/bin`, add execute permissions and edit the `ALLOW_COUNTRIES` line to suit your needs:

```bash
$ cd SSHD-GeoIP-Filter
$ sudo cp sshd-geoip-filter.sh /usr/local/bin/
$ sudo chmod +x /usr/local/bin/sshd-geoip-filter.sh
$ cd SSH-GeoIP-Filter
$ sudo cp ssh-geoip-filter.sh /usr/local/bin/
$ sudo chmod +x /usr/local/bin/ssh-geoip-filter.sh

# Edit line '5' in `sshd-geoip-filter.sh` to countries that you want to allow ssh from:
4: # UPPERCASE space-separated ISO country codes to ACCEPT
Expand All @@ -75,7 +75,7 @@ $ sudo chmod +x /usr/local/bin/sshd-geoip-filter.sh
sshd: ALL

# After `sudo nano /etc/hosts.allow` add in this line:
sshd: ALL: aclexec /usr/local/bin/sshd-geoip-filter.sh %a
sshd: ALL: aclexec /usr/local/bin/ssh-geoip-filter.sh %a
```
- Using aclexec in hosts.allow will allow the sshd service to take into account the exit code and abort connection attempts.

Expand Down

0 comments on commit bcd63c8

Please sign in to comment.