Skip to content

Conversation

@andrewleech
Copy link

@andrewleech andrewleech commented Oct 20, 2025

ET currently fails to connect through jump hosts when the jump host uses a non-standard SSH port or when ProxyJump references an SSH config Host alias.

For example, with this SSH config:

Host jumphost
  HostName jump.example.com
  Port 2222

Host destination
  HostName dest.example.com
  ProxyJump jumphost

Running et destination fails with Could not reach the ET server: jumphost:2022

The issue is that the ProxyJump parsing code was stripping SSH ports from the jump host value:

if (colonIndex != string::npos) {
  jumphost = proxyjump.substr(0, colonIndex);  // Strips :2222
}

Additionally, Host aliases like "jumphost" weren't being resolved to actual hostnames, so ET tried to connect to the alias name instead of the configured hostname.

This PR fixes both issues by:

  • Preserving the full ProxyJump value [user@]host[:port] when passing to SSH via -J flag
  • Extracting just the hostname from the ProxyJump value for ET socket connections
  • Looking up Host aliases in SSH config to get the actual hostname

Tested with the config above. Before the fix et destination fails, after it successfully connects via jump.example.com:2222 (SSH) -> destination (ET).

No breaking changes expected - existing ProxyJump configurations should continue to work, though I don't currently have a working jumphost setup to verify backwards compatibility directly.

ET was stripping SSH ports from ProxyJump values and failing to resolve
SSH config host aliases, breaking connections through jump hosts with
non-standard SSH ports.

Changes:
- Preserve full ProxyJump value including SSH port for ssh -J flag
- Extract hostname correctly from [user@]host[:sshport] format
- Resolve ProxyJump host aliases via SSH config lookup

Fixes connections like:
- ProxyJump jumphost:2222 (explicit SSH port)
- ProxyJump jumphost (where jumphost is SSH config alias with custom port)

Before: "Could not reach the ET server: jumphost:2022"
After: Successfully connects using correct SSH port for jump host
ET was using the destination username for ProxyJump connections instead
of the jumphost's username defined in SSH config.

With this SSH config:
  Host telie
    User corona
  Host step
    User anl
    ProxyJump telie

Running 'et step' would incorrectly try 'anl@home.alelec.net' instead
of 'corona@home.alelec.net' for the jumphost connection.

Fix: Parse jumphost SSH config to extract its username, use that for
the -J flag. Fallback to local username if not specified.
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.

2 participants