Open dcechano opened 2 months ago
Can you actually connect to {SETTINGS.remote_host}:{SETTINGS.remote_port}
from your SSH server?
The hang is likely your server waiting for the failed connection to timeout and ChannelOpenFailure(ConnectFailed)
is the server stating it could not connect to the remote target.
Can you actually connect to
{SETTINGS.remote_host}:{SETTINGS.remote_port}
from your SSH server? The hang is likely your server waiting for the failed connection to timeout andChannelOpenFailure(ConnectFailed)
is the server stating it could connect to the remote target.
Thank you for getting back to me. Yes I am able to connect to the ssh server. I tested it using the ssh -i /path/to/aws_key.pem -p 22 -L 12345:remote_host_ip:55022 user@jump_host_ip
and it connects with no issue.
But are you then able to connect to localhost:12345
? Just running an SSH connection with -L
does not open a direct-tcpip
channel by itself, that only happens once you actually connect to the local port.
But are you then able to connect to
localhost:12345
? Just running an SSH connection with-L
does not open adirect-tcpip
channel by itself, that only happens once you actually connect to the local port.
Ok. I understand what you are saying. How do you suggest I connect to it from the ssh server? Would a ping be sufficient or should I open a tcp stream and try writing to it?
Yes, you can just use netcat: nc <target-ip> <target-port>
on your SSH server
Thank you! I will try this. I appreciate your help.
I am trying to set up simple port forwarding through a jump host. I am doing this by using
client::connect
to get aclient::Handle
then (after authenticating) using the handle to open a Tcp/Ip forwarding channel throughclient::Handle::channel_open_direct_tcpip
.I have noticed that the
Handler::openssh_ext_host_keys_announced
is the lastHandler
method to execute. This suggests that the server is responding to the forwarding request and willing to allow it. I am suspicious that I am not implementing this method properly and the server is waiting for me to confirm the public keys and it eventually stops waiting and closes the connection. Is this correct? If so how do you confirm the public keys?To investigate I have confirmed that the server is responding to ssh and port forwarding by using the GNU
ssh
command that is native to linux. I have also opened connections without port forwarding (viarussh
) and they seem to return just fine. Does any one have any suggestions on avenues I could explore that may shed light on the issue? I appreciate the help. Thank you! (Console output below)