Skip to content

ssh: manual auth use ssh hostname config - #195

Open
manuel-rw wants to merge 1 commit into
fosrl:mainfrom
manuel-rw:ssh-alias-config-identity
Open

manuel-rw wants to merge 1 commit into
fosrl:mainfrom
manuel-rw:ssh-alias-config-identity

Conversation

@manuel-rw

@manuel-rw manuel-rw commented Nov 21, 2026 •

Copy link
Copy Markdown

pangolin ssh invoked ssh(1) with the API-resolved hostname and always passed the ephemeral JIT key with IdentitiesOnly=yes. For manual-auth (passthrough) resources no certificate is issued, so the JIT key can never authenticate, IdentitiesOnly blocked config/default identities, and in native daemon mode the resolved host is a site IP, so the user's "Host " block never matched at all.

  • Pass the alias the user typed as the ssh(1) destination and pin the connection target with -o HostName=. OpenSSH then applies the full config for the alias (IdentityFile, User, Port, ProxyJump, and anything future) while Pangolin's tunnel resolution stays authoritative.
  • When the server issues no certificate (manual authentication), skip the JIT key and IdentitiesOnly so ssh(1) resolves identities from ~/.ssh/config, default key paths, and ssh-agent, with password fallback. Explicit -i passthrough keeps precedence.
  • Reject --builtin in manual mode with a clear message; the pure-Go client only supports JIT certificate auth.
  • Unit tests for argv construction: JIT mode, manual mode, alias matching, explicit -i forwarding, port, remote command ordering.

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

AI Disclosure

Mistral Vibe was used in this PR to debug and generate the code. The requirements were written manually and a manual smoke test with my own setup was performed. Because I don't use Pangolin to its full extend, I cannot confirm whether this breaks existing SSH setups. Please review carefully.

…IT key for manual auth

pangolin ssh invoked ssh(1) with the API-resolved hostname and always
passed the ephemeral JIT key with IdentitiesOnly=yes. For manual-auth
(passthrough) resources no certificate is issued, so the JIT key can
never authenticate, IdentitiesOnly blocked config/default identities,
and in native daemon mode the resolved host is a site IP, so the
user's "Host <alias>" block never matched at all.

- Pass the alias the user typed as the ssh(1) destination and pin the
  connection target with -o HostName=<resolved>. OpenSSH then applies
  the full config for the alias (IdentityFile, User, Port, ProxyJump,
  and anything future) while Pangolin's tunnel resolution stays
  authoritative.
- When the server issues no certificate (manual authentication), skip
  the JIT key and IdentitiesOnly so ssh(1) resolves identities from
  ~/.ssh/config, default key paths, and ssh-agent, with password
  fallback. Explicit -i passthrough keeps precedence.
- Reject --builtin in manual mode with a clear message; the pure-Go
  client only supports JIT certificate auth.
- Unit tests for argv construction: JIT mode, manual mode, alias
  matching, explicit -i forwarding, port, remote command ordering.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
@manuel-rw
manuel-rw marked this pull request as ready for review November 21, 2026 16:10
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.

1 participant