-
-
Notifications
You must be signed in to change notification settings - Fork 932
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
Using bastion jump host proxy gateway times out #852
Comments
I'm having the same issue, which is also related to the request in #530. Several proxy options are available, but these do not include a SSH Jump. However, I don't like this workaround, as it opens up the connection to your destination server for any program outside the one your running, and uses a several locally connected ports to work... |
This workaround is similar to what was proposed in #195. |
As an update. I've forked the repo and added an option to connect through jump servers. This uses a slightly altered version of the port forwarding mechanism. When a jump channel is created, I shortly create a TCP listener socket on a free (local) port and use it to connect a local Socket. Once this local socket is connected, I dispose of the listener, as no further connections should be made through this listener. Using this connected socket, I instantiate a directtcpip channel and use it to connect to the remote server. The code is available in this commit. |
Opening two SSH-Connections and use LocalForward is the way to go for a ProxyJump using SSH. The same does ssh(1). Your implemtation is not correct, since ProxyJump can actually be anything forwarding TCP-Connections. |
@darinkes, thanks for the pointer. I'll try to rewrite it a bit, so it can be passed via the proxy connection settings. |
Rewrite is done. Update includes possibility for multiply sequential proxy connections, and new |
@JoostJM is there, or has there already been, a pull request open to bring your changes located at https://github.com/JoostJM/SSH.NET/tree/jump-channel into https://github.com/sshnet/SSH.NET? |
@benrobot I've finished refactoring the code to deal with recent changes (such as async connections). Initially, there were quite some tests failing, but those are fixed now as well. If you want, this feature is available in the jump-channel branch in my fork of the repo. |
I have verified that the following two lines work on fine on both my WSL2 (Linux on Windows) as well as Windows 10 (finally, Windows comes with
ssh
):I have also verified that,
if I start the ssh connection using
then the following code successfully connects and I'm able to query my database.
But the equivalent .NET code times out (yes, I did kill the command line SSH connection first). The contents of my
.ssh/id_rsa
file is the same as what I'm passing intoconfig.PrivateKey
and I know it worked because I am able to connect to bastion/jump host/proxy/gateway directly using the private key as configured.The text was updated successfully, but these errors were encountered: