Skip to content

Support ssh-agent keys for native SSH#903

Closed
radiantjade wants to merge 1 commit into
railwayapp:masterfrom
radiantjade:support-ssh-agent-keys
Closed

Support ssh-agent keys for native SSH#903
radiantjade wants to merge 1 commit into
railwayapp:masterfrom
radiantjade:support-ssh-agent-keys

Conversation

@radiantjade
Copy link
Copy Markdown

Summary

  • include public keys from ssh-add -L when checking/registering SSH keys
  • keep file-backed ~/.ssh/*.pub keys preferred when the same fingerprint is also exposed by the agent
  • update SSH key and DB stats messaging so agent-backed setups do not get told only to create files in ~/.ssh

Fixes #870.

Testing

  • PATH="$HOME/.cargo/bin:$PATH" cargo test

Railway SSH currently preflights only public key files under ~/.ssh, which blocks forwarded agents and keychain-backed SSH setups before the native ssh client can authenticate. The change treats ssh-add -L public keys as available local keys for registration and matching, while preserving file-backed keys as the preferred source when both are present.

Constraint: Native ssh already supports SSH_AUTH_SOCK, but the CLI key preflight ran before ssh was spawned.

Rejected: Skip SSH key preflight entirely | would remove useful registration guidance for users with no registered keys.

Confidence: medium

Scope-risk: narrow

Tested: PATH="/Users/jeonhwichan/.cargo/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pkg/env/active/bin:/opt/pmk/env/global/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/Applications/VMware Fusion Tech Preview.app/Contents/Public:/usr/local/share/dotnet:~/.dotnet/tools:/Users/jeonhwichan/.codex/tmp/arg0/codex-arg0DAF9FL:/Users/jeonhwichan/.nvm/versions/node/v20.19.4/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/path:/Users/jeonhwichan/.pyenv/shims:/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/bin:/opt/homebrew/opt/postgresql@16/bin:/opt/homebrew/opt/mysql@8.0/bin:/opt/homebrew/opt/curl/bin:/Users/jeonhwichan/development/flutter/bin:/opt/homebrew/opt/php@7.4/sbin:/opt/homebrew/opt/php@7.4/bin:/Users/jeonhwichan/go/bin:/Users/jeonhwichan/.opencode/bin:/opt/homebrew/share/google-cloud-sdk/bin:/Users/jeonhwichan/.bun/bin:/Users/jeonhwichan/.local/bin:/Users/jeonhwichan/.nvm/versions/node/v20.19.4/bin:/Users/jeonhwichan/.cargo/bin:/Applications/Ghostty.app/Contents/MacOS:/Users/jeonhwichan/Library/Application Support/JetBrains/Toolbox/scripts:/Users/jeonhwichan/.pub-cache/bin:/Users/jeonhwichan/Library/Android/sdk/platform-tools:/Users/jeonhwichan/Library/Application Support/JetBrains/Toolbox/scripts" cargo test
@radiantjade
Copy link
Copy Markdown
Author

radiantjade commented May 15, 2026

This PR will need one of the release labels for the label-check workflow. I do not have permission to add labels on this repo; release/patch should be appropriate for this fix.

@brody192 brody192 closed this May 15, 2026
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.

railway ssh ignores ssh-agent, fails when keys aren't on disk

2 participants