-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Problem / Background
The SSH config file (~/.ssh/config) ProxyJump directive is correctly parsed but never applied during connection establishment. The get_proxy_jump() function exists in the codebase but is never called, meaning connections completely ignore the ProxyJump setting from SSH config.
This breaks compatibility with OpenSSH behavior where users expect ProxyJump directives to work automatically.
Current Behavior
- bssh parses
~/.ssh/configand readsProxyJumpdirectives correctly SshHostConfig.proxy_jumpfield is populated during parsingget_proxy_jump(hostname)method exists insrc/ssh/ssh_config/mod.rs:142- However, this method is never called anywhere in the codebase
- Connections ignore the ProxyJump setting from SSH config
Expected Behavior
When connecting to a host that has ProxyJump configured in ~/.ssh/config, bssh should automatically use that jump host. This should work similarly to OpenSSH's behavior.
Example SSH Config:
Host internal-server
HostName 192.168.1.100
User admin
ProxyJump bastion.example.com
Host bastion.example.com
User jumpuser
Port 22
When running bssh internal-server 'ls', bssh should automatically use bastion.example.com as the jump host.
Root Cause
The function get_proxy_jump() is defined but never integrated into the connection flow:
// src/ssh/ssh_config/mod.rs:142-144
pub fn get_proxy_jump(&self, hostname: &str) -> Option<String> {
resolver::get_proxy_jump(&self.hosts, hostname)
}This method needs to be called during connection establishment, and the returned jump host spec should be passed to the jump host chain.
Proposed Solution
- In
src/app/initialization.rsor connection setup code, callssh_config.get_proxy_jump(hostname) - Merge SSH config ProxyJump with CLI
-Joption (CLI should take precedence) - Pass the resolved jump host to the connection logic
Priority Order for Jump Host Resolution:
- CLI
-Joption (highest priority) - SSH config
ProxyJumpdirective - bssh config.yaml
jump_host(when implemented - see feat: Add jump_host field support in config.yaml #115)
Acceptance Criteria
-
get_proxy_jump()is called during connection setup for each target host - ProxyJump from SSH config is used when no CLI
-Joption is specified - CLI
-Joption takes precedence over SSH config ProxyJump - Connections through SSH config ProxyJump work for command execution
- Connections through SSH config ProxyJump work for file transfers (upload/download)
- Add test cases for ProxyJump resolution priority
Affected Files
src/ssh/ssh_config/mod.rs-get_proxy_jump()exists but unusedsrc/ssh/ssh_config/resolver.rs- resolver function existssrc/app/initialization.rs- needs to integrate ProxyJump resolutionsrc/app/dispatcher.rs- needs to pass resolved jump host
Related Issues
- feat: Add jump_host field support in config.yaml #115 - Add jump_host support to config.yaml (different config system, lower priority)
- fix: Jump host authentication fails with empty SSH agent despite available key files #116 - Jump host auth fails with empty SSH agent (related jump host functionality)