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.1.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.1-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.1.tar.gz.

File metadata

File hashes

Hashes for py_ssh_ip_block_xethhung12-0.0.1.tar.gz
Algorithm Hash digest
SHA256 65689e4410c2e449c6b4ac4055c3f25d1c3e0bf6abd3c0f60da0d57824d274a7
MD5 5586279e68f4aa65be395f8ffdfbcd45
BLAKE2b-256 d0f445c1c827e4b86b6f743cc086db5ff9a502bd3472ee262eb58e9f3af8edec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_ssh_ip_block_xethhung12-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b4b677f1fab1367d93ea208b73d1998a8465dd328b7cb55ea29e3c6e1615054
MD5 8343c4eeedf6b0053342bb782e097a85
BLAKE2b-256 edfbadbb3a47d718d5c6908db8a8ce4f6da83df1211fad878d377bf8be389e05

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