Indy 9 | Content | Index | Reference

TIdRexec
Hierarchy, Properties, Methods, Events, See Also, Unit: IdRexec
This class implements Remote Execution (Rexec) as a client.

    TIdRexec = class(TIdRemoteCMDClient)

Unit
IdRexec
Description
This class implements Unix Remote Execution (Rexec) as a client. The Rexec protocol is sometimes used to run tasks from remote locations while requiring password authentication. This protocol was originally intended as a temporary "hack" in some older Berkeley Unix Distributions that came into wide usage.

Note that while this protocol is a little more secure than RSH, it still can pose a security hazard on the Internet because the User ID and password are sent in plain-text and that can easily be intercepted by someone wanting to run destructive program.

To use this component:

- Set the TIdRexec.Host to the I.P. Address or name of the remote machine.

- Set the TIdRexec.UserName to the user's remote User ID

- Set the TIdRexec.Password to the user's password

- Use the TIdRexec.Execute method with the command to run on the remote machine

TIdRexec.Password
TIdRexec, See Also
Account authorization used for the connectiong to the remote host.

    property Password;

Description
Password is a String property that represents the account authorization used for the connectiong to the remote host. Username and Password are used for authentication of the connection when the Execute method is called.

TIdRexec.Port
TIdRexec, See Also
Port number for the connection to the Rexec server.

    property Port: integer;

Description
Port is an Integer property that identifies the port number for connecting to an Rexec server. The default value for Port is Id_PORT_exec which is commonly used for the Rexec protocol. Port is updated in the Create method.

TIdRexec.Username
TIdRexec, See Also
Account identification used for connecting to the remote host.

    property Username;

Description
Username is a String property that represents the account identification used for connecting to the remote host. Username and Password are used for authenticating the client connection when the Execute method is called.

TIdRexec.Create
TIdRexec, See Also
Instantiates a TIdRexec instance.

    constructor Create(AOwner: TComponent); override;

Parameters
AOwner: TComponent
Owner of the object instance.
Description
Create

Create constructs a properly initialized instance of TIdRexec using the inherited Create constructor, and initializes Port to the constant value Id_PORT_exec (Decimal 512) as required by the Rexec Protocol.

TIdRexec.Execute
TIdRexec, See Also
This method executes a command (ACommand) on the RSH Deamon.

    function Execute(ACommand: String): String; override;

Parameters
ACommand: String
The command to execute on the remote system.
Return Value
String - The results from the command that was executed or no value if an error occurred.
Description
This method authenticates to the Rexec Deamon with the TIdExec.UserName and the TIdRexec.Password and than executes a command (ACommand) on the Rexec Deamon. This is only intended for non-interactive processes where the no input is expected from the user.

If an error occurred, TIdRemoteCMD.ErrorReply is set to true and the TIdRemoteCMD.ErrorMessage contains the message returned from the Rexec Deamon. The inherited TIdRemoteCMDClient.UseStdError property effects how error messages are sent from the Rexec Deamon.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.