ScSSHShell Changing working directory

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
TheUnknow
Posts: 2
Joined: Wed 22 Aug 2018 00:46

ScSSHShell Changing working directory

Post by TheUnknow » Wed 22 Aug 2018 00:53

I notice with ScSSHShell when using ScSSHShell1.ExecuteCommand('cd /usr'); it does not appear to change directory. Odd thing is this works in SSHClient demo, but I can't get it to in my own program.

The only thing I see different in SSHClient demo compare to my code is it uses ScSSHShell1.WriteString(SomeString + #13#10), I try using ScSSHShell1.WriteString(SomeString + #13#10) to see if this makes a difference, but I get "Cannot send data to server".

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

Re: ScSSHShell Changing working directory

Post by ViktorV » Thu 23 Aug 2018 10:55

The specificity of the shell channel is that after the command is executed using the TScSSHShell.ExecuteCommand method, the channel will be closed by the server after the command result is received.
To solve your task, you can send commands to the server using the TScSSHShell.WriteString or TScSSHShell.WriteBuffer methods, after execution of which the channel does not close: https://devart.com/sbridge/docs/tscsshs ... string.htm, https://devart.com/sbridge/docs/tscsshc ... uffer. htm read the result using the TScSSHShell.ReadString method.
Please make sure that you are using the same settings for the TScSSHShell and TScSSHClient components in your sample and our demo sample. If so, please send us a small sample using the contact form https://devart.com/company/contactform.html, demonstrating the specified behavior, with test access to your server.
The "Cannot send data to server" error may occur, for example, when a connection to the server has been broken.

stlcours
Posts: 33
Joined: Wed 14 Sep 2011 20:22

Re: ScSSHShell Changing working directory

Post by stlcours » Fri 24 Aug 2018 20:38

when will you release the new versions? As many bug fixed............

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

Re: ScSSHShell Changing working directory

Post by ViktorV » Tue 28 Aug 2018 11:36

We are planning to release the next build of SecureBridge within two or three months.

Post Reply