English · Tiếng Việt
Know the moment someone logs in to your Linux server, or tries to.
PAMSignal watches the systemd journal for SSH, sudo, su and console logins, and sends an alert to Telegram, Slack, Microsoft Teams, Discord, WhatsApp or your own webhook within seconds. One small C daemon, one config file, no agents or servers to run.
[NOTICE] auth.login_success user=admin src=192.168.1.100:52341 host=web-01 service=sshd auth=publickey pid=4211 ts=2026-11-24T09:12:03+0700
[INFO] auth.session_opened user=root actor=admin host=web-01 service=sudo pid=4250 ts=2026-11-24T09:12:40+0700
[ALERT] auth.brute_force_detected src=203.0.113.50 attempts=12 window=300s user=root host=web-01 pid=4377 ts=2026-11-24T09:15:02+0700
[CRIT] auth.login_after_failures user=root src=203.0.113.50:40122 failures=12 window=300s host=web-01 service=sshd auth=password pid=4390 ts=2026-11-24T09:15:20+0700
Prefer a multi-line message on your phone? Set message_style = pretty.
- Logins: successful and failed SSH logins, with source IP and auth method.
- Privilege changes:
sudo,suand console sessions, including who became root (actor=). - Brute force: repeated failures from one IP, or repeated wrong
sudo/supasswords from one account. - A guessed password: a successful login right after a run of failures from the same IP. This is the alert you never want to miss.
Every event is also written to the journal as structured fields (journalctl -t pamsignal), whatever you send to chat. Forged entries (for example logger -t sshd) are ignored.
Debian / Ubuntu
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://anhtuank7c.github.io/pamsignal/key.asc | sudo gpg --dearmor -o /etc/apt/keyrings/pamsignal.gpg
echo "deb [signed-by=/etc/apt/keyrings/pamsignal.gpg] https://anhtuank7c.github.io/pamsignal stable main" | sudo tee /etc/apt/sources.list.d/pamsignal.list
sudo apt update && sudo apt install pamsignalFedora / RHEL 9 / AlmaLinux 9 / Rocky Linux 9
# Fedora
sudo dnf config-manager addrepo --from-repofile=https://anhtuank7c.github.io/pamsignal/rpm/fedora/pamsignal.repo
# RHEL 9 / AlmaLinux 9 / Rocky Linux 9
sudo dnf config-manager --add-repo https://anhtuank7c.github.io/pamsignal/rpm/el9/pamsignal.repo
sudo dnf install pamsignalUbuntu 20.04 (Focal)
Focal has no apt repository; install the signed .deb from the latest release:
VERSION=0.8.0
curl -fLO "https://github.com/anhtuank7c/pamsignal/releases/download/v${VERSION}/pamsignal_${VERSION}-1_focal_amd64.deb"
sudo apt install "./pamsignal_${VERSION}-1_focal_amd64.deb"Packages are signed with key 2D2C 828F A6F4 D019 E446 8FBB B106 2235 2862 2F69. Other distributions: see Supported distributions or build from source.
Edit /etc/pamsignal/pamsignal.conf. For Telegram:
telegram_bot_token = <your_bot_token>
telegram_chat_id = <your_chat_id>Slack, Teams, Discord, WhatsApp and custom webhooks: Alert setup.
sudo -u pamsignal pamsignal --check-config # validate the file
sudo -u pamsignal pamsignal --test-alert # send a test message to every channel
sudo systemctl reload pamsignal
journalctl -t pamsignal -f # watch events liveThe defaults work out of the box. The keys you are most likely to change:
| Key | Default | What it does |
|---|---|---|
fail_threshold / fail_window_sec |
5 / 300 |
Failures within the window that count as brute force |
alert_cooldown_sec |
60 |
Seconds before the same alert repeats (same event, user and source; brute force: same source). 0 turns it off |
enable_notification_type |
all |
Which events reach chat: login_success, login_failed, session_open, session_close, brute_force, login_after_failures, all |
trusted_sources |
empty | CIDR list (office, VPN, bastion) whose routine logins stay out of chat; attacks from them still alert |
message_style |
compact |
pretty for a multi-line layout |
provider / service_name |
empty | Tags added to every alert, handy across many hosts or customers |
Every key, with ranges and examples: Configuration.
- Custom webhook: alerts as ECS JSON for any SIEM or script, with optional bearer token and mTLS. Example receivers in Node.js and Python.
- Fail2ban: ban brute-forcing IPs at the firewall using PAMSignal's detection: guide.
- Grafana: one dashboard for the whole fleet through Loki and Alloy: Grafana from zero.
- who-did-what: a read-only report of who logged in, who became root and what they ran: script.
- Secure SSH and manage a fleet: stop sharing root, harden
sshd, trace who did what - Use cases: solo, small team and hosting-provider setups
- Configuration · Alerts and payloads · Deployment
- Threat model: what PAMSignal sees and what it does not
- Architecture · Development · Supported distributions
- Security policy · Contributing · Changelog
Thanks to Nguyen Hong Quan, whose push for reading PAM events from systemd-journald instead of /var/log/auth.log, and for strict FHS paths, shaped the design; and to Samuel Le, whose books and encouragement kept the project going.
PAMSignal is built with AI assistance (Claude Code); the .claude/ directory shows exactly how. Every release is tested on real systems by a human who takes responsibility for it.

