Remote port-forwarding with GatewayPorts

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
ED-Clint
Posts: 36
Joined: Thu 18 May 2017 08:52

Remote port-forwarding with GatewayPorts

Post by ED-Clint » Mon 05 Oct 2020 13:00

Hi,

I can get this to work until I want to turn GatewayPorts on.

If I setup an SSHClient with Channel and set the Remote property to True I get the reverse tunnel.
To see what ports the SSHServer is listening on I can see;

sshd 7599 adminuser 10u IPv4 207296262 0t0 TCP 127.0.0.1:10075 (LISTEN)

When I set GatewayPorts to True nothing changes and I cannot connect to the forwarded ports from a remote host.
Checking what the server is listening on I see;

sshd 7599 adminuser 10u IPv4 207296262 0t0 TCP 127.0.0.1:10075 (LISTEN)

If remote hosts were able to use these ports should I not be seeing the following?

sshd 7599 adminuser 10u IPv4 207296262 0t0 TCP *:10075 (LISTEN)


How do I allow remote hosts to use the forwarded ports?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Remote port-forwarding with GatewayPorts

Post by ViktorV » Thu 08 Oct 2020 15:01

GatewayPorts works only for local port forwarding. For remote port forwarding, we pass 0.0.0.0; however, most servers only support localhost connections. If you manage to configure the server the way you need it using any other client, please let us know the details.

ED-Clint
Posts: 36
Joined: Thu 18 May 2017 08:52

Re: Remote port-forwarding with GatewayPorts

Post by ED-Clint » Fri 30 Oct 2020 13:28

Hi Viktor,

Thank you. Can I ask how I achieve the remote port-forwarding that you detail in your SecureBridge SSH-tunnel principles document then please?

I want to create a tunnel between an SSH Client and an SSH Server and for Sn computers on the SSH Server side to be able to communicate with a port on the SSH Server that is connected to the SSH Client end.

I use the "SSH Client", "SSH Server" and "Sn" terminology because this is what is used on your document.

Specifically I am looking to access MySQL on an SSHClient from Sn computers at the SSH Server end.

ED-Clint
Posts: 36
Joined: Thu 18 May 2017 08:52

Re: Remote port-forwarding with GatewayPorts

Post by ED-Clint » Mon 02 Nov 2020 07:56

Hi Viktor,

I tried this using a Windows Server as the SSH Server and the SSH Server software on there was your sample of a simple SSH Server. The reverse tunnels work and I can connect from computers Sn on the SSH Server side network.

So the issue above seems to be with Linux allowing the remote connections or something similar. I'm not sure but clearly the issue is not the code and probably not your components!

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Remote port-forwarding with GatewayPorts

Post by ViktorV » Mon 02 Nov 2020 16:15

Thank you for your interest in our product.
Yes, such behavior is mostly likely caused by the settings of the SSH server or remote machine.
Feel free to contact us if you have any further questions about our products.

Post Reply