Skip to content

fix: pin sish tunnel auth to the dedicated key with IdentitiesOnly - #551

Merged
venkatamutyala merged 1 commit into
mainfrom
fix/sish-identities-only
Aug 2, 2026
Merged

fix: pin sish tunnel auth to the dedicated key with IdentitiesOnly#551
venkatamutyala merged 1 commit into
mainfrom
fix/sish-identities-only

Conversation

@venkatamutyala

Copy link
Copy Markdown
Contributor

One flag on the autossh invocation: -o IdentitiesOnly=yes.

A sish v2.23.0 source review of the tunnel auth flow found two failure modes when it's absent (both require a forwarded ssh-agent, which appears whenever dev is re-run from a tmux session after an SSH login — and every dev run restarts autossh):

  1. Permanent silent lockout: OpenSSH offers agent keys before -i file identities. sish calls the TOFU authenticator once per offered key, and the first accepted key is pinned to the username forever. If an agent key wins the VM's first-ever connection, everything works until the agent disappears (detach/reboot → systemd path) — then every reconnect is a key mismatch 403 and the tunnel is dead until the user's file in sish_users/ is deleted by hand.
  2. MaxAuthTries exhaustion: sish inherits x/crypto's default of 6 auth attempts; an agent carrying ≥5 keys gets the connection dropped before the tunnel key is ever offered, even when the TOFU registration is already correct.

IdentitiesOnly=yes restricts the client to exactly ~/.ssh/sish_tunnel_key_id_ed25519, eliminating both. No behavior change for the systemd boot path (no agent there) — this hardens the interactive re-run path.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ErBUiAYTosnpbF9hvUj3Dn

Without it, a forwarded ssh-agent (present when dev is re-run inside
tmux after an SSH login) offers its keys before the -i file: sish's
TOFU authenticator pins the first accepted key per username, so an
agent key winning the first-ever connection silently locks the VM out
of its tunnel once that agent disappears. Agent keys could also exhaust
the SSH server's MaxAuthTries (6) before the tunnel key is offered.
Found by a sish v2.23.0 source review of the auth webhook contract.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ErBUiAYTosnpbF9hvUj3Dn
@venkatamutyala
venkatamutyala merged commit 68091f8 into main Aug 2, 2026
2 checks passed
@venkatamutyala
venkatamutyala deleted the fix/sish-identities-only branch August 2, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant