Indy 9
|
TIdRSHServer = class(TIdRemoteCMDServer)
By convention, TIdRSHServer forces all client connection requests to use port numbers outside the reserved range 0 through 1023. TIdRSHServer allows creation of a secondary client connection to be used for redirecting standard error output to the RSH client. A secondary connection is created when a non-null valid port number is provided in the connection request.
TIdRSHServer uses the source address of the client connection request to determine the name of the client host. If the name cannot be determined, the rshd daemon uses the dotted decimal representation of the client host address.
When a client thread is executed for TIdRSHServer, values are read from the client connection for the user name on the client host, user name on the local server, and the password for use on the local server.
TIdRSHServer provides the OnCommand event handler to allow the implementation to control platform-specific authentication and execution of the command for the RSH session.
property DefaultPort: integer;
The default value for DefaultPort is Id_PORT_cmd as assigned in the Create method.
property ForcePortsInRange: Boolean;
Usually, this should be set to true to prevent non-administrative users from using the RSH server. Setting this to false should be done with the utmost caution as it will increase the likelihood for abuse. The reason RSH requires clients to connect from ports in the 512-1023 range is because on most multi-user operating systems, this ensures some security as only administrators on those systems could use it. However, "security" is somewhat limited because many single user operating systems will not prevent non-administrator users from using those reserved ports and it is possible for hackers to alter port numbers on packets.
constructor Create(AOwner: TComponent); override;
property OnCommand: TIdRSHCommandEvent;
OnCommand is signalled after the optional connection for redirected standard error output has been created, bound, and successfully connected. In addition, null terminated values for the client user name, host user name, and the RSH command have been read from the request connection prior to triggering OnCommand.
Applications must assign a procedure to the event handler to allow responding to the event notification. The event handler can be used to authenticate the client and host user name values, to execute the command, and to send error or result values using the optional connection for redirected standard error output.