Skip to content

Tailscale SSH check mode: ServerAliveInterval kills the session before you can approve the check URL

TL;DR.

With ServerAliveInterval set in ~/.ssh/config, ssh to a Tailscale SSH host in check mode times out ~3 intervals after printing the login.tailscale.com URL; raise ServerAliveCountMax so the session waits for approval.

Tailscale SSH policies in check mode make ssh host print

# Tailscale SSH requires an additional check.
# To authenticate, visit: https://login.tailscale.com/a/<id>

and then hold the connection open until someone approves the URL in a browser. While it waits, the server sends nothing, so OpenSSH's keepalive counts every unanswered probe. With ServerAliveInterval 10 in ~/.ssh/config (and the default ServerAliveCountMax 3), the client gives up after ~30 s:

Connection to 100.x.y.z port 22 timed out
rsync: connection unexpectedly closed (0 bytes received so far) [sender]

That reads like a network problem, and the URL you were shown is dead with the session. Any automated caller (an agent, rsync, a script) loses the race unless a human approves within those 30 s.

Fix: keep the waiting session alive long enough for the approval, then reuse the approved check for later connections:

ssh -o ServerAliveCountMax=120 host 'echo ready'   # ~20 min at a 10 s interval

Show the URL, keep that process waiting (or retry until it prints # Authentication checked with Tailscale SSH.), and only then run the real commands; follow-up ssh/rsync calls go through without a new prompt until the check period expires. Observed on macOS OpenSSH to Ubuntu with tailscaled 1.104.5, 2026-11-12.

No signals yet