Skip to main content

Monitor SSH login attempts on your server - see who's trying to break in

Project description

auth-watcher ๐Ÿ”

Monitor SSH login attempts on your server. See who's trying to break in.

Inspired by Knock-Knock.net - a visualization of server attacks that went viral on Hacker News.

Installation

pip install auth-watcher

Usage

# Show summary of all login attempts
auth-watcher --summary

# Real-time monitoring (like tail -f)
auth-watcher

# Show top 20 attackers
auth-watcher --top 20

# JSON output for scripts
auth-watcher --json

Example Output

============================================================
๐Ÿ” AUTH-WATCHER ๅฎ‰ๅ…จๆŠฅๅ‘Š
============================================================

๐Ÿ“Š ๆ€ป่ฎก:
   โŒ ๅคฑ่ดฅ็™ปๅฝ•: 8,523
   โœ… ๆˆๅŠŸ็™ปๅฝ•: 42

๐ŸŽฏ Top 10 ๆ”ปๅ‡ป่€… IP:
   154.193.217.4        2048 ๆฌก  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  (Los Angeles, US)
   103.145.88.12        1256 ๆฌก  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  (Shanghai, CN)
   45.33.32.156          892 ๆฌก  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  (Singapore, SG)

๐Ÿ‘ค Top 10 ่ขซๅฐ่ฏ•็š„็”จๆˆทๅ:
   root                 3258 ๆฌก  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
   admin                 688 ๆฌก  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
   ubuntu                456 ๆฌก  โ–ˆโ–ˆโ–ˆโ–ˆ
   test                  234 ๆฌก  โ–ˆโ–ˆ

Features

  • ๐Ÿ“Š Summary stats - Total failed/successful logins
  • ๐ŸŽฏ Top attackers - IPs with most failed attempts + geolocation
  • ๐Ÿ‘ค Username analysis - Most targeted usernames
  • ๐Ÿ‘€ Real-time watch - Live monitoring with colored output
  • ๐Ÿ“‹ JSON export - For scripts and automation

Requirements

  • Linux server with SSH
  • Python 3.8+
  • Root access (to read /var/log/auth.log)

Supported Systems

  • Ubuntu / Debian (/var/log/auth.log)
  • RHEL / CentOS (/var/log/secure)
  • Other Linux distros (use --log to specify path)

Security Tips

If you're seeing thousands of failed logins (you probably are):

  1. โœ… Disable password auth - Use SSH keys only
  2. โœ… Use fail2ban - Auto-ban repeat offenders
  3. โœ… Change SSH port - Move away from 22
  4. โœ… Use a firewall - Restrict access by IP

License

MIT - Built by IndieKit

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

auth_watcher-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

auth_watcher-0.1.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file auth_watcher-0.1.0.tar.gz.

File metadata

  • Download URL: auth_watcher-0.1.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for auth_watcher-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f7c957e35e91d4c105025665269f1b0acfc201ea6394732f37d6359ff63a28ea
MD5 b6683ba3eea33f6be58a63a5862e7074
BLAKE2b-256 c9d1d66b3177b836176f4660b790662caaab477ffb5267eb62112b0e8e94b5f3

See more details on using hashes here.

File details

Details for the file auth_watcher-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: auth_watcher-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for auth_watcher-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4294a0a06b3975858c5751a8050de17fd8cfa3065261a581fe6791809c2c720d
MD5 d0407e6b76b2250fbeb308e753dda9a6
BLAKE2b-256 ae4fd20140bb237c6e874b1bf2f9af5ab89560a21c46672f435138cb7e3b2bc5

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