Skip to main content

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

Release files for auth-watcher 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for auth-watcher 0.1.0
File Size Uploaded
auth_watcher-0.1.0.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for auth-watcher 0.1.0
File Interpreter ABI Platform
auth_watcher-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.1 kB

Release files / auth_watcher-0.1.0.tar.gz

Download URL auth_watcher-0.1.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f7c957e35e91d4c105025665269f1b0acfc201ea6394732f37d6359ff63a28ea
BLAKE2b-256 checksum
How to use checksums
c9d1d66b3177b836176f4660b790662caaab477ffb5267eb62112b0e8e94b5f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / auth_watcher-0.1.0-py3-none-any.whl

Download URL auth_watcher-0.1.0-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4294a0a06b3975858c5751a8050de17fd8cfa3065261a581fe6791809c2c720d
BLAKE2b-256 checksum
How to use checksums
ae4fd20140bb237c6e874b1bf2f9af5ab89560a21c46672f435138cb7e3b2bc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page