feat: delegate SSH config aliases to native OpenSSH#346
Closed
itzhang89 wants to merge 2 commits into
Closed
Conversation
When ssh_host matches a Host alias in ~/.ssh/config (and neither ssh_password nor ssh_proxy_jump is set), spawn the system ssh client so ProxyJump chains, nested aliases, and per-hop credentials are handled by OpenSSH. Direct hosts, password auth, and explicit ssh_proxy_jump continue to use the ssh2 tunnel. Co-authored-by: Cursor <cursoragent@cursor.com>
Member
|
Thanks. For non-trivial changes like this, please open an issue first for discussion |
SSHTunnel.establish now receives a single SSHTunnelEstablishRequest object from ConnectorManager instead of separate config and options args. Co-authored-by: Cursor <cursoragent@cursor.com>
Author
|
Thanks for the review. Understood — we'll open an issue first to discuss this approach before submitting a PR. Closing for now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ssh_hostis a~/.ssh/configHost alias (e.g.target-with-jumpwithProxyJump mybastion), DBHub parses the config and re-implements the jump chain via thessh2library. This breaks common setups because:ProxyJumpvalues that are themselves aliases (e.g.mybastion) are treated as literal hostnamessshclientsshclient whenssh_hostis a resolvable SSH config alias (nossh_password, no explicitssh_proxy_jump). OpenSSH handles ProxyJump, nested aliases, and per-host credentials. The existingssh2implementation remains for direct hosts, password auth, and explicitssh_proxy_jump.--ssh-hostalias in single-source CLI mode (instead of replacing it withHostName), and mapproxyJumptossh_proxy_jump.Example
~/.ssh/config:dbhub.toml:Equivalent to:
ssh -N -L 127.0.0.1:<port>:10.0.1.100:5432 target-with-jumpTest plan
ssh-tunnel.test.tsstill passesssh_host = "target-with-jump"with nestedProxyJump mybastionin~/.ssh/configssh_password/ssh_proxy_jumpstill use ssh2Made with Cursor