Page 1 of 1

Can't get to use ssh client/channel/server to port forwarding

Posted: Wed 21 Mar 2018 21:10
by jcanon
Hi I made both simple IP client and simple IP server just to test the hability to port forward of securebridge, and I was using this topic in the forum as a configuration guide:

viewtopic.php?f=27&t=12016&p=35668&hilit=channel#p35668

(dbexpres and SecureBridge) but I can not get my programs to work,

Can you help me please?

I will try to describe what I'm using:

***************************************************************
Simple_IP_Client (in 192.168.197.130)
----Config : Connect to ip: 192.168.197.1
------------ Connect to port:1000

CONNECT TO


Simple_IP_Server (in 192.168.197.1)
---Config: port:1000

***************************************************************
Connecting Simple_IP_Client to Simple_IP_Server does work as expected using previous configuration (not using securebridge at all)

But using:


***************************************************************
Simple_IP_Client (in 192.168.197.130)
----Config : Connect to ip: 192.168.197.130
------------ Connect to port:22

CONNECT TO

sshClient (in 192.168.197.130)
--- Config: HostName: 192.168.197.1
----------- port: 22

USING

sshChannel (in sshClient)
--- Config: DestHost: 192.168.197.1
----------- DestPort: 1000
----------- SourcePort: 22
----------- Direct:False
----------- Remote : already tryed True and False

CONNECT TO

sshServer (in 192.168.197.1)
--- Config: port:22

CONNECT TO

Simple_IP_Server (in 192.168.197.1)
---Config: port:1000

**************************************************
In previuos configuration:

-sshClient connect fine to sshServer
-sshChannel connect without any errors
- Simple_IP_Client fails with asynchronous socket error 10061, same error is generated when trying to connect directly to Simple_IP_Server using wrong port

What I'm missing? How should I configure ssh Client / Channel/Server?

By the way I'm using very simply IP client -server (just connect and nothing more) and very simple ssh client-server as instructed in "Step-by-step Tutorial" from the Securebridge pdf manual (using last trial version).

Re: Can't get to use ssh client/channel/server to port forwarding

Posted: Thu 22 Mar 2018 11:56
by ViktorV
To solve your task, you can use the following recommendations:
If the SSH Server: IP is 192.168.197.1, the port is 22; Simple server: IP - 192.168.197.1, port - 1000, to create a secure connection to Simple server, please use the following settings:
SSHClient:

Code: Select all

SSHClient.HostName := 192.168.197.1;
SSHClient.Port := 22;
ScSSHChannel:

Code: Select all

ScSSHChannel.SourcePort = Port_To_Simple_Client; //any port available for listening on the machine on which SSH client is running
ScSSHChannel.DestHost := 192.168.197.1;
ScSSHChannel.DestPort := 1000;
Simple client:

Code: Select all

Server := SSHClient_Adress; //IP or host name of the machine on which SSH client is running
Port := Port_To_Simple_Client;
When using a local forwarding port:
- the SourcePort property is any listening port on the machine on which the SSH client is running;
- the DestHost property is the address of the machine with which the SSH server will establish a connection. If you specify a relative DNS hostname (for example, localhost), then this address is specified relative to the SSH server, not the SSH client;
- the DestPort property is the port on the machine specified in the DestHost property, with which the TCP/IP connection will be established.
For more information on using the local forwarding port, you can refer to SecureBridge help: https://devart.com/sbridge/docs/ssh_tun ... ciples.htm
For testing, we can use the SSHClient demo, and in this case you can specify the port forwarding setting by clicking the "Settings" button and choosing the "Port forwarding" tab. You can find the SSHClient project in the %SecureBridgeDemos%\SSHClient directory. %SecureBridgeDemos% is the SecureBridge Demo projects installation path on your computer.

Re: Can't get to use ssh client/channel/server to port forwarding

Posted: Thu 22 Mar 2018 21:09
by jcanon
Thank you very much ViktorV,

Now is working for me! :)

By the way, if anybody else is having the same issues, you also have to put the GatewayPorts property in scSSHChannel to TRUE, otherwise port forwarding won't work

Re: Can't get to use ssh client/channel/server to port forwarding

Posted: Mon 26 Mar 2018 06:42
by ViktorV
Glad to see that the issue was resolved.
Feel free to contact us if you have any further questions about our products.