feat: Support SSH config Host alias reference in jump_host configuration #171
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
Following up on #167, this PR adds support for referencing SSH config Host aliases in bssh's
jump_hostconfiguration. This allows users to leverage existing~/.ssh/configentries with all their settings.New Formats Supported
Simple string with @ prefix:
Structured format:
How It Works
When an SSH config reference is used, bssh resolves the alias from
~/.ssh/configand extracts:HostName(or uses alias as hostname if not specified)UserPortIdentityFile(first one, used as SSH key for the jump host)Example
~/.ssh/config:
bssh config.yaml:
This is equivalent to:
Changes
SshConfigHostRefvariant toJumpHostConfigenumis_ssh_config_ref()andssh_config_host()methods toJumpHostConfigresolve_jump_host()andresolve_jump_host_connection()toSshConfigget_jump_host_with_key_and_ssh_config()for full SSH config resolutionexample-config.yamlwith SSH config reference examplesTest Plan
Closes #170