Skip to content

Fix file-based OpenSSH key signing without ssh-agent - #31

Open
jrhunger wants to merge 2 commits into
TritonDataCenter:mainfrom
jrhunger:use-keys-without-ssh-agent
Open

Fix file-based OpenSSH key signing without ssh-agent#31
jrhunger wants to merge 2 commits into
TritonDataCenter:mainfrom
jrhunger:use-keys-without-ssh-agent

Conversation

@jrhunger

@jrhunger jrhunger commented Jul 10, 2026

Copy link
Copy Markdown

Summary

  • Fix triton-cli authentication when keys are loaded from ~/.ssh without a running ssh-agent
  • Replace ssh_key::PrivateKey::sign("", …) (SSHSIG / namespace invalid) with raw signing via RustCrypto for OpenSSH-format
    keys
  • Route sign_with_key through the same corrected path
  • Add regression tests that sign and verify OpenSSH keys (ed25519, RSA, ECDSA P-256/P-384, PEM round-trip)

Problem

KeySource::auto tries ssh-agent first, then scans ~/.ssh. When the agent is unavailable, signing an OpenSSH-format key (e.g.
id_ed25519) failed with:
triton: error: Signing error: SSH signing failed: namespace invalid
ssh-agent worked because it signs the raw HTTP signing string; the file path incorrectly used ssh-key's SSHSIG API.

Test plan

  • cargo test -p triton-auth (includes 5 new OpenSSH signing regression tests)
  • cargo clippy -p triton-auth --all-targets -- -D warnings
  • Manual: unset SSH_AUTH_SOCK, run triton with default ~/.ssh/id_ed25519 profile — command should authenticate
    successfully

AI usage

  • Analysis and updates done using Cursor with Opus4.8

Closes #29

When triton-cli falls back to ~/.ssh keys (no ssh-agent), OpenSSH-format
keys failed with "namespace invalid" because signing used ssh-key's SSHSIG
API. Sign raw key material with RustCrypto instead, matching the SSH agent
wire format CloudAPI expects.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

triton-cli: "triton: error: Signing error: SSH signing failed: namespace invalid"

2 participants