Discuss this help topic in SecureBlackbox Forum
Use remote terminal (shell)
To connect to remote terminal using simple SSH, you need to initiate the connection as described in the corresponding how-to article.
Before calling Open() method of TElSimpleSSHClient, you can adjust certain settings, specific to remote shell.
First of all, you can specify the environment variables. This is done using Environment property of TElSimpleSSHClient class.
Also, if you implement a remote terminal,
you can create an instance of TElTerminalInfo class
and assign it to TerminalInfo property of TElSimpleSSHClient class.
TElTerminalInfo class lets you specify the parameters of the remote terminal,
such as width and height of the terminal window, and width and height of the terminal buffer, and the type of the terminal.
TElTerminalInfo properties can be changed when the connection is already established.
If you need to change several parameters when the connection is already present,
use BeginUpdate() method of TElTerminalInfo class before you change parameters
and EndUpdate() method of TElTerminalInfo class after you've finished your changes.
After you've set the needed parameters, call Open() method of TElSimpleSSHClient class.
Use SendData() or SendText() method of TElSimpleSSHClient class to send the data to the remote server. Use CanReceive() method of TElSimpleSSHClient class to check, if there's the data to receive. If the data is available, use ReceiveData() or ReceiveText() method to receive the remote data.
Remember, that when you connect to remote shell, the server actually starts the shell program (sh/bsh/csh/tcsh on Unix, cmd.exe on Windows). So, when you receive the initial data, you will receive a shell prompt. To execute some command you will need to send the command line, followed by CRLF (or CR or LF, depending on the server) to execute it. The response will also be followed by the shell prompt. If you need to just execute one or several commands and grab their output, you can use command channel (see more information in the corresponding how-to article).