EldoS | Feel safer!

Software components for data protection, secure storage and transfer

How to Stop a command in SSH ?

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
Posted: 07/16/2008 06:05:22
by Fred Fred (Basic support level)
Joined: 07/16/2008
Posts: 2

I try the demo version of blackbox ssh component for Delphi.
I'm playing with demo provided with the demo component and i've got one question. How can i stop a linux command like "top" ?. In putty i can put a ctrl+c ... but here i don't know how to do. The problem is that this kind of command never finish.
Thanks for any answer.
(French, sorry for my english)
Posted: 07/16/2008 07:23:03
by Eugene Mayevski (EldoS Corp.)

How exactly are you sending a command?

Sincerely yours
Eugene Mayevski
Posted: 07/16/2008 07:45:45
by Fred Fred (Basic support level)
Joined: 07/16/2008
Posts: 2

I used the example you provide in the directory "simpleSSH". In the command line i put "top" ... which is a linux command to get list of process running on server... but when i put this command i "loose hand" and can't send another linux command (i think it's normal because the top command don't "leave hand" until a ctrl+C or something like that)...so what i want to know is how to stop a running command to allow me to send another command (ex to send a "ctrl+c"-like !).

The code of the example is :
  s := Edit5.Text + {#13}#10;
  Client.SendData(PChar(S), Length(s));
  Edit5.Text := '';

Thanks a lot.
Posted: 07/16/2008 08:03:41
by Eugene Mayevski (EldoS Corp.)

Ctrl-C sequence is translated to some escape sequence in SSH and telnet. You need to send this sequence with SendData method.
Unfortunately I don't know what exactly sequence must be sent for Ctrl-C.

Sincerely yours
Eugene Mayevski
Posted: 07/16/2008 13:46:37
by Mykola Olshevsky (Basic support level)
Joined: 07/07/2005
Posts: 450

As I remember correctly, Ctrl-C corresponds to binary 0x03. Try to send 0x03 through SendData() and see what happens.
But, also, this all depends on terminal settings on the other side.
Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages



Topic viewed 1475 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!