Auto SSH auth fallback fails after agent signer error with IdentityFile key
Describe the problem:
In Tabby 1.0.236/1.0.237, SSH profiles imported from ~/.ssh/config can fail in Auto authentication when a configured private key has a matching .pub file and that key is not available to the local SSH agent. The failure is not specific to Ed25519.
A controlled test on the same SSH server and account reproduced the same failure with both RSA and Ed25519 keys. OpenSSH successfully authenticated with each key. For each Tabby test, the matching .pub file existed and agent identities were empty. Tabby logged Loaded public key for agent auth, then AgentFailure, Inconsistent, and authentication rejection. Before adding the RSA .pub companion, the imported RSA profile had connected in Tabby. The temporary Ed25519 authorized key and local test keys have since been removed.
The agent-first ordering for imported profiles was intentional (#11357, related discussion #11352). The bug is that Tabby continues to another authentication method on the same russh client after an identity-specific agent signing failure:
- When a configured private key has a
.pubcompanion, Tabby adds an identity-specific agent method before the generic agent fallback and disk-key method (v1.0.236 source). - The client sends the public-key probe. The server responds
SSH_MSG_USERAUTH_PK_OK, requesting proof by signature. - The local agent has no matching identity and cannot sign (
AgentFailure). In russh 0.63.3,authenticate_publickey_with()returns the signer error before sendingMsg::Signed(source); the session handler is still awaiting that response (source). - Tabby catches the agent error and tries later methods on the same session (v1.0.237 source). The later disk-key attempt fails with
Inconsistent.
Explicit Key authentication succeeds with the same key. The UI message Failed to load private key ... Inconsistent does not prove the key parser failed because its try/catch also includes the authentication call (source). The controlled RSA and Ed25519 results indicate the key algorithm is not the trigger; the identity-specific agent attempt followed by same-session fallback is.
To Reproduce:
- Configure an SSH profile with
IdentityFilepointing to a valid key whose public key is authorized by the server. - Ensure the matching
.pubfile exists, the agent does not hold that key, and profile authentication isAuto. - Connect using Tabby 1.0.236 or 1.0.237.
- Repeat with RSA and Ed25519 on the same server; both reproduced in the controlled test.
Actual behavior:
Authentication fails after the agent signing attempt; the disk-key fallback returns Inconsistent.
Expected behavior:
When agent signing fails because the agent does not hold the configured identity, Auto should recover and authenticate using the valid disk key, or restart authentication on a fresh SSH session. Explicit Key with the same key succeeds.
Platform: macOS controlled reproduction; Windows failure was also reported.
Source: Eugeny/tabby