sshd: add ClientAliveInterval to reap zombie mobile sessions #102
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Mobile SSH from Kai's phone (Termux + Tailscale) leaves zombie sessions attached on kai-server when the phone backgrounds Tailscale (Android battery optimization). Counted 7 zombie pty sessions from the same source IP, oldest from ~36h prior, all idle, sshd had no idea they were dead.
Why this matters
The zombies don't break anything immediately but they (a) noise up
w/last/ session audits, (b) hold pty slots, (c) make it harder to spot a genuinely active mobile session during the next mobile-SSH debug round. Tracking doc for that debug effort:coilysiren/mobile-ssh-debug.mdon Kai's workstation (not yet in a repo).Proposed fix
Add to
/etc/ssh/sshd_config.d/(new drop-in, e.g.99-mobile-keepalive.conf):This reaps dead sessions in ~3 minutes (60s × 3 unanswered probes) without affecting healthy long-running sessions. Mosh sessions are unaffected because they don't traverse sshd after handoff.
Out of scope (root cause is client-side)
Settings → Apps → Tailscale → Battery → Unrestrictedon the phone. This ticket is the server-side hygiene piece only.Filed by Claude under coilysiren/agentic-os-kai AGENTS "Default TODO Destination" rule.