Metadata-Version: 2.4
Name: py_ssh_ip_block_xethhung12
Version: 0.0.1
Summary: A small to scan the auth.log for faill ssh access and block the ip address that with fail count more than threshold
Project-URL: Homepage, https://github.com/pypa/sampleproject
Project-URL: Issues, https://github.com/pypa/sampleproject/issues
Author-email: Xeth Hung <admin@xethh.me>
License-Expression: GPL-3.0-only
License-File: LICENSE
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown


# py_ssh_ip_block_xethhung12
## Installation
```shell
pip install py-ssh-ip-block-xethhung
```

## Prerequisite
Before start using the tool, two operation is required
1. Create ipset
    ```shell
    ipset create {set-name} hash:ip 
    ```
2. add iptables rule
    ```shell
    sudo iptables -A INPUT -m set --match-set {set-name} src -p tcp --destination-port {port} -j DROP 
    ```

## Execution
Run through python project script
```shell
py-ssh-ip-block-xethhung12 -h
```

## Delete Rules
Delete iptables rule
```shell
# get rule number
sudo iptables -L INPUT --line-numbers

# delete rule by line number
sudo iptable -D INPUT 2 
```