SSH2 custom SUBSYSTEM

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
milan.gsm
Posts: 5
Joined: Fri 20 Oct 2017 17:02

SSH2 custom SUBSYSTEM

Post by milan.gsm » Fri 20 Oct 2017 17:09

I need to create the connection to the SSH2 server and SUBSYSTEM specified for the server.
I have not found any detailed info, how to specify the SSH2 subsystem ?!

When the SSH2 connection is made wihtout the SUBSYSTEM specified, I got the following response from server:

You need to open SSH2 subsystem, try:

ssh -p 722 -l login_name -i your_id_rsa_key xxx.xxx.xxx.xx -s SSH_SUBSYSTEM_IDENTIFIER


Actually the SSH2 subsystem identifier needed to be used is: "linterface" (without the quotes)

This is the UNIX command equivalent to iniciate the necessary connection.

Is it possible to make connection like this using the SecureBridge and DELPHI XE3 ???

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

Re: SSH2 custom SUBSYSTEM

Post by ViktorV » Wed 25 Oct 2017 06:44

To solve your task, you can use the TScSSHSubSystem class declared in the ScSSHChannel module by setting the TScSSHSubSystem.Subsystem property to the required value in it.

milan.gsm
Posts: 5
Joined: Fri 20 Oct 2017 17:02

Re: SSH2 custom SUBSYSTEM

Post by milan.gsm » Wed 25 Oct 2017 20:16

Thank you very much for the suggestion. I will test it during the weekend and post the result here.

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

Re: SSH2 custom SUBSYSTEM

Post by ViktorV » Thu 26 Oct 2017 10:00

Thank you for being interested in our products.
Feel free to contact us if you have any further questions about our products.

milan.gsm
Posts: 5
Joined: Fri 20 Oct 2017 17:02

Re: SSH2 custom SUBSYSTEM

Post by milan.gsm » Wed 01 Nov 2017 19:32

Hello, I have done som tests with secure bridge, but I am not sure yet.

ScSSHClient1.Authentication:= atPublicKey;
ScSSHClient1.KeyStorage:= ScMemStorage1;
ScSSHClient1.HostKeyName:= 'SERVER_KEY';
ScSSHClient1.PrivateKeyName:= 'PRIVATE_KEY';
ScSSHClient1.hostname:= 'xxx.xxx.xxx.xxx';
ScSSHClient1.User:= 'xxxxxxxxx';
ScSSHClient1.Port:= 722;
ScSSHClient1.Connected:= True;
ScSSHShell1.Client:= ScSSHClient1;
//TScSSHSubSystem(ScSSHShell1).Subsystem:= 'linterface';
ScSSHShell1.NonBlocking:= True;
ScSSHShell1.Connected:= True;

Is this usage of TScSSHSubSystem correct ???

The next think is: is it possible to DISABLE the echo of sent commands ???

Every sent command using: ScSSHShell1.WriteString('<?xml version="1.0" encoding="UTF-8"?>');
fire the: procedure TForm1.ScSSHShell1AsyncReceive(Sender: TObject);
and push the echo as input ...

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

Re: SSH2 custom SUBSYSTEM

Post by ViktorV » Fri 03 Nov 2017 15:24

You can use the provided code using the TScSSHSubSystem class.
All data transferred from the server are passed to the event handler OnAsyncReceive. And if the server sends you an echo, then you will receive it in the event handler OnAsyncReceive.

Post Reply