Skip to main content

A small to scan the auth.log for faill ssh access and block the ip address that with fail count more than threshold

Project description

py_ssh_ip_block_xethhung12

Installation

pip install py-ssh-ip-block-xethhung

Prerequisite

Before start using the tool, two operation is required

  1. Create ipset
    ipset create {set-name} hash:ip 
    
  2. add iptables rule
    sudo iptables -A INPUT -m set --match-set {set-name} src -p tcp --destination-port {port} -j DROP 
    

Execution

Run through python project script

py-ssh-ip-block-xethhung12 -h

Delete Rules

Delete iptables rule

# get rule number
sudo iptables -L INPUT --line-numbers

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_ssh_ip_block_xethhung12-0.0.3.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_ssh_ip_block_xethhung12-0.0.3-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file py_ssh_ip_block_xethhung12-0.0.3.tar.gz.

File metadata

File hashes

Hashes for py_ssh_ip_block_xethhung12-0.0.3.tar.gz
Algorithm Hash digest
SHA256 23f658b7c4ec90744dd9f012e1e8c830af1cb56cbccc81a1aea95c29d3d7937d
MD5 2e7d7d6b65de45eba042e72357e4503e
BLAKE2b-256 276644ebf59ba54a548ebdaec9fbf79d26ffb39758a4842235bca92a88b5987b

See more details on using hashes here.

File details

Details for the file py_ssh_ip_block_xethhung12-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for py_ssh_ip_block_xethhung12-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0edb7144af6c7916acf062fb24f0df3cbe6fa51caba7b11db576cb4e160a3baa
MD5 a0d321cfb7240910e971ea973802aa08
BLAKE2b-256 63098d382759c4ea307cb49e86ca413a2e256e69efc7d16d5a7e0560e4376805

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page