I need to establish a ssh connection via socket to connect to a MySQL database.
How to setup ScSSHClient similar to
ssh -L 5001:/var/lib/mysql/mysql.sock user@server
environment: MyDAC 11.0.2 Professional / SecureBridge 10.0.1 / RAD-Studio 11
ssh connection using socket
Re: ssh connection using socket
In order to create a secure connection to MySQL server via SSH you can use the TMySSHIOHandler component and SecureBridge components.
The TMySSHIOHandler component is intended for communicating between SecureBridge and MyDAC. This component is included into MyDAC as a demo project. You can find the component package by the following path: MyDAC_InstDir\Demos\TechnologySpecific\SecureBridge\Delphi27\mydacsbridge270.dpk.
MyDAC_InstDir is the MyDAC installation directory on your computer.
Just open this package and install it.
The TMySSHIOHandler component is intended for communicating between SecureBridge and MyDAC. This component is included into MyDAC as a demo project. You can find the component package by the following path: MyDAC_InstDir\Demos\TechnologySpecific\SecureBridge\Delphi27\mydacsbridge270.dpk.
MyDAC_InstDir is the MyDAC installation directory on your computer.
Just open this package and install it.
-
- Posts: 5
- Joined: Sat 05 Jan 2019 10:37
Re: ssh connection using socket
I already have installed TMySSHIOHandler.
With OpenSSH outside my application I establish the ssh connection with this command:
ssh -L 5001:/var/lib/mysql/mysql.sock user@server.
Afterwards TMyConnection works fine.
But how can I configure TScSSHClient accordingly? What parameter(s) correspond to
-L 5001:/var/lib/mysql/mysql.sock?
Thanks for help!
With OpenSSH outside my application I establish the ssh connection with this command:
ssh -L 5001:/var/lib/mysql/mysql.sock user@server.
Afterwards TMyConnection works fine.
But how can I configure TScSSHClient accordingly? What parameter(s) correspond to
-L 5001:/var/lib/mysql/mysql.sock?
Thanks for help!
Re: ssh connection using socket
Kindly be informed that the way you describe involves using Socks services (mysql.sock).
But SecureBridge does not support Socks services. However, if you use TMyConnection in combination with TMySSHIOHandler, then there is no need to use Socks services because TMyConnection will directly pass data to TScSSHClient without using intermediate sockets or services.
For information on how to configure TMySSHIOHandler, please have a look at our documentation https://docs.devart.com/mydac/ssh.htm
If after reading the article there will be still some questions, feel free to contact us.
But SecureBridge does not support Socks services. However, if you use TMyConnection in combination with TMySSHIOHandler, then there is no need to use Socks services because TMyConnection will directly pass data to TScSSHClient without using intermediate sockets or services.
For information on how to configure TMySSHIOHandler, please have a look at our documentation https://docs.devart.com/mydac/ssh.htm
If after reading the article there will be still some questions, feel free to contact us.
-
- Posts: 5
- Joined: Sat 05 Jan 2019 10:37
Re: ssh connection using socket
Thanks for your reply.
Since the ssh server I want to connect to is not under my control I have to use the socks service.
Since the ssh server I want to connect to is not under my control I have to use the socks service.
Re: ssh connection using socket
Unfortunately, SecureBridge does not support MySQL sock service.