-
-
Notifications
You must be signed in to change notification settings - Fork 192
Fix ProxyJump to support SSH ports and host aliases #705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
@andrewleech now that master has the ci setup fixed, could you rebase so we can make sure the tests all pass. Potentially consider adding a new test case to the connect_with_jumphost but using the ssh path you have fixed. |
- Preserve SSH port from ProxyJump value for ssh -J flag - Parse [user@]host[:sshport] format correctly (including IPv6) - Resolve ProxyJump host aliases via SSH config lookup - Extract jumphost username from SSH config - Use resolved hostname (not alias) in SSH command - Add freeOptionsFields helper to ParseConfigFile.hpp - Add system test for ProxyJump with SSH config alias
44bc863 to
64b2688
Compare
|
Thanks for the suggestions @jshort |
|
@andrewleech looks like this is breaking CI? |
- Move parseHostString to HostParsing.hpp for reuse and testing - Add unit tests covering IPv4, IPv6, user@host, and port combinations - Add edge case tests for empty string and malformed IPv6
64b2688 to
6d3be72
Compare
Oh I see. So in a PR of mine just recently (tunnel/reversetunnel support for bind address and ssh -L/-R notation) I implemented ipv6 bracket parsing of -L/-R arguments. Do you think this logic for the tunnel args and your host parsing for ipv6 addrs in brackets can be shared? Also maybe an OBOE (note trailing colon):
|
The merge from master incorrectly kept the old {jumphost, SSH_SCRIPT_JUMP}
arguments instead of the corrected jump_ssh_args vector that includes
the -p port flag when a port is specified in the jumphost.
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:
Running
et destinationfails withCould not reach the ET server: jumphost:2022The issue is that the ProxyJump parsing code was stripping SSH ports from the jump host value:
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:
[user@]host[:port]when passing to SSH via-JflagTested with the config above. Before the fix
et destinationfails, 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.