-
Notifications
You must be signed in to change notification settings - Fork 360
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
Support for more than one jump host #318
Comments
Looks like a shortcoming/bug in SshClient.java, As a work-around, try
That should work (if I read the code right), and also should work with openSSH. |
@tomaswolf thanks for the quick response! I tested the workaround and it's working with one edit: the order of the proxy must be changed: Host host*.dmz.corp
ProxyJump nightman@jump1:22,nightman@jump2:22 The other settings like in the original post. For the native SSH client the order must be like proposed by you :-( Tested with openSSH 1.0.2 k on RH 7 and 1.1.1 i in a git bash. |
So there's even a bug in that implementation in Apache MINA sshd. Really :-(. |
If it will help I can run tests with a fixed pre package. |
Thanks for the offer. I won't have any time for any coding in the next few weeks, but perhaps someone else takes this on. Otherwise I'll take look sometime in March. |
Any update? |
Nope; I didn't get around to this yet. But it's up for grabs; we do welcome PRs. |
A PR #477 is available to fix this issue. I tested it with the 2 configurations below. configuration 1:
configuration 2:
|
Previous code only parsed the proxy jumps of the initial HostConfigEntry. However, if the last entry in that list has a HostConfigEntry that again has proxy jumps, these additional proxies must be added to the list. And so on. To guard against proxy cascades with loops we limit the total number of proxies to at most 10. The limit is configurable through property CoreModuleProperties.MAX_PROXY_JUMPS. Bug: apache#318
Description
I have a special server running to which the connection is only possible via 2 jump hosts and my configuration for SSH looks like this:
Host jump1 Hostname jump1.corp Port 22 User nightman LogLevel QUIET Host jump2 HostName jump2.dmz.corp Port 22 User nightman ProxyJump jump1 LogLevel QUIET Host host*.dmz.corp ProxyJump nightman@jump2:22
This is working well with the native SSH clients.
It would be nice when your great libary would support such a configuration as well!
:-)
Motivation
Enhancements would make the library better usable for jump hosts.
Alternatives considered
There is no workaround I found so far.
Additional context
No response
The text was updated successfully, but these errors were encountered: