Page 1 of 1

SSH2 custom SUBSYSTEM

Posted: Fri 20 Oct 2017 17:09
by milan.gsm
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 ???

Re: SSH2 custom SUBSYSTEM

Posted: Wed 25 Oct 2017 06:44
by ViktorV
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.

Re: SSH2 custom SUBSYSTEM

Posted: Wed 25 Oct 2017 20:16
by milan.gsm
Thank you very much for the suggestion. I will test it during the weekend and post the result here.

Re: SSH2 custom SUBSYSTEM

Posted: Thu 26 Oct 2017 10:00
by ViktorV
Thank you for being interested in our products.
Feel free to contact us if you have any further questions about our products.

Re: SSH2 custom SUBSYSTEM

Posted: Wed 01 Nov 2017 19:32
by milan.gsm
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 ...

Re: SSH2 custom SUBSYSTEM

Posted: Fri 03 Nov 2017 15:24
by ViktorV
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.