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
--logto specify path)
Security Tips
If you're seeing thousands of failed logins (you probably are):
- ✅ Disable password auth - Use SSH keys only
- ✅ Use fail2ban - Auto-ban repeat offenders
- ✅ Change SSH port - Move away from 22
- ✅ Use a firewall - Restrict access by IP
License
MIT - Built by IndieKit
Metadata
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| auth_watcher-0.1.0.tar.gz | 5.4 kB | Without provenance | Details for auth_watcher-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| auth_watcher-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for auth_watcher-0.1.0-py3-none-any.whl |
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
|
Security for auth-watcher 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.