"Cannot send data to server" using TScSSHClient (NonBlocking NOT enabled)

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
mchonedog
Posts: 3
Joined: Thu 24 Aug 2017 06:21

"Cannot send data to server" using TScSSHClient (NonBlocking NOT enabled)

Post by mchonedog » Thu 24 Aug 2017 06:31

Hi guys,

I've downloaded the trail for SecureBridge, looking to do some automation of certain actions on our linux servers. I'm having a few issues when using a TScSSHShell component with the NonBlocking property set to false.

I've set the TScSSHClient to connect on FormShow and disconnect on FormDestroy, but when running the following code, it complains saying "Cannot send data to server". Works fine with NonBlocking set to true, but that doesn't fit my use case:

Code: Select all

function TForm3.ExecCmd(ACommand: string): string;
var
  sLine: string;
begin
  Result := '';
  ScSSHShell1.WriteString(ACommand + #13); // Blows up here
  repeat
    sLine := ScSSHShell1.ReadString;
    if (sLine <> '') then begin
      Result := Result + sLine;
    end;
  until (sLine = '');
end;

procedure TForm3.FormDestroy(Sender: TObject);
begin
  if (ScSSHClient1.Connected) then
    ScSSHClient1.Disconnect;
end;

procedure TForm3.FormShow(Sender: TObject);
begin
  if (not ScSSHClient1.Connected) then
    ScSSHClient1.connect;
end;
Image

The command I attempted to send was 'echo "Hello World"'.

Running Delphi 10.2 Tokyo (Update 1).

Thanks for the help in advance,

Michael.

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

Re: "Cannot send data to server" using TScSSHClient (NonBlocking NOT enabled)

Post by ViktorV » Fri 25 Aug 2017 09:42

Please check whether the issue is reproduced on our SSHClientApp demo project and inform us about the result.
Our SSHClientApp demo project demonstrating the use of the TScSSHShell component. You can find the SSHClientApp project in the% SecureBridgeDemos%\SSHClientApp directory. %SecureBridgeDemos% is the directory where SecureBridge Demo projects are installed on your computer.

mchonedog
Posts: 3
Joined: Thu 24 Aug 2017 06:21

Re: "Cannot send data to server" using TScSSHClient (NonBlocking NOT enabled)

Post by mchonedog » Fri 01 Sep 2017 04:03

In that example you use the NonBlocking mode. It doesn't fit our use case.

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

Re: "Cannot send data to server" using TScSSHClient (NonBlocking NOT enabled)

Post by ViktorV » Fri 01 Sep 2017 10:40

Unfortunately, we cannot reproduce the issue. Both in the NonBlocking mode and without it, the error does not appear in our test environment.
Please, specify the exact version of the used SSH server.

mchonedog
Posts: 3
Joined: Thu 24 Aug 2017 06:21

Re: "Cannot send data to server" using TScSSHClient (NonBlocking NOT enabled)

Post by mchonedog » Mon 04 Sep 2017 00:15

We're using the latest version of sshd on our Linux Server. We are not using your SSH server component.

Server says: OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g 1 Mar 2016.

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

Re: "Cannot send data to server" using TScSSHClient (NonBlocking NOT enabled)

Post by ViktorV » Tue 05 Sep 2017 12:33

Unfortunately, we cannot reproduce the issue on your server version SSH.
To investigate the issue, please provide us test access to your server.

Post Reply