Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.SSH.Server

Feature notes: SSH implementation notes

Classes, interfaces and records

interfaceiSSHServerController

Base contract for a pluggable server-side handler that an application registers with a TstSSHServer (via AddSubSystemController / AddListenerController / AddSenderController). The server keeps a list of these controllers and dispatches an incoming SSH request to whichever one matches by Identifier; an app implements this (or uses the ready-made TstSSHListenerControllerSocket / TstSSHSenderControllerSocket components) to add support for a subsystem, a tcpip-forward listener, or a direct-tcpip sender without subclassing the server.

function GetIdentifier: string;
Returns the wire name this controller answers to. The server compares it against the incoming request's channel-type or global-request name (e.g. 'tcpip-forward', 'direct-tcpip', or a subsystem name) and dispatches the request to registered controllers whose Identifier matches, in registration or... Full description »
property Identifier: string read GetIdentifier;
The wire name (channel type / global-request / subsystem name) this controller handles; used by the server purely for request routing. See GetIdentifier.

interfaceiSSHSubSystemController

inherits from iSSHServerController

function NewSubSystem(const aChannel: iSSHServerChannel) : iSSHServerSubSystem;

interfaceiSSHListenerController

inherits from iSSHServerController

Controller that implements server-side remote port forwarding (the client's "tcpip-forward" global request, i.e. OpenSSH's -R). An app registers one via TstSSHServer.AddListenerController so that when an authenticated client asks the server to listen on an address/port, the server (in FindListener) calls GetListener to obtain the object that will open the local listening socket and channel new inbound connections back to the client. The shipped TstSSHListenerControllerSocket implements this with Identifier 'tcpip-forward'. This is server-side only.

function GetListener(aBroker : tAbstractSSHServerChannelBroker): tAbstractSSHForwardedListener;
Called by the server when a matching tcpip-forward request has been authorized: create and return the listener that binds the requested port and forwards accepted connections over the SSH channel supplied by aBroker. Return nil to decline. An app rarely calls this directly; the server invokes it during request dispatch.

interfaceiSSHSenderController

inherits from iSSHServerController

Controller that implements server-side local port forwarding (the client's "direct-tcpip" channel open, i.e. OpenSSH's -L). An app registers one via TstSSHServer.AddSenderController so that when a client opens a direct-tcpip channel to a target host/port, the server (in FindSender) calls GetSender to obtain the object that opens the onward TCP connection and pumps data both ways. The shipped TstSSHSenderControllerSocket implements this with Identifier 'direct-tcpip'. This is server-side only.

function HostNameToAddress(const aHostName: string): string;
Resolves the client-requested target host name to a numeric IP address before the onward connection is made (the socket implementation returns the name unchanged if it is already an IPv4/IPv6 literal, otherwise it does a DNS lookup). The server calls this so authorization callbacks can match on a concrete address; apps normally leave it to the controller.
function GetSender(const aChannel: iSSHServerChannel; const aBuf : tBytes; aOffset : Integer; aCount : Integer) : iSSHDirectRawEvents;
Called by the server when a matching, authorized direct-tcpip channel is opened: create and return the sender that connects to the requested target and relays traffic over aChannel. aBuf/aOffset/aCount carry the channel-open payload (e.g. the connect request already received). Return nil to decline. The server invokes this during channel dispatch; apps rarely call it directly.

classTstCustomSSHServer

(no public members)

classtSSHClientServerThread

inherits from TThread

constructor Create(aServer : TstCustomSSHServer; aSocket : Cardinal; const aTransport: iSSHServerTransport); destructor Destroy; override;

classtUserItem

inherits from TCollectionItem

constructor Create(Collection: TCollection); override;
Creates one user account and its per-user subsystem option list, seeding the PBKDF2 iteration count and hash from the owning TstSSHServerUsers defaults. Called internally when the collection grows; an app adds accounts via tUserCollection.Add rather than constructing this directly.
destructor Destroy; override;
Frees the account's subsystem list and services strings. Internal teardown; an app removes accounts through the collection, not by calling this.
function AuthPassword(const aPassword: string): Boolean;
Verifies a password offered by a connecting client against this account. Server-side only: the userauth pipeline calls it to accept or reject a password login. When a plain-text password is stored it compares directly; otherwise it re-derives the PBKDF2 verifier from aPassword and the stored salt and compares that -- so accounts persisted without SavePlainPassword still authenticate.
function SupportsSubSystem(const aSubSystemName: string): Boolean;
Tests whether this account is allowed to open the named SSH subsystem (e.g. "sftp"). The server consults it after login to decide whether to honour a subsystem channel request from this user.
function SupportsTcpIpForward(const aAddress: string; aPort : UInt32) : Boolean;
Tests whether this account may request a remote (server-to-client) port forwarding listener on the given bind address and port, matching the address family / localhost-vs-any / privileged-vs-unprivileged bits in ListenerRights. The server calls it when the client sends a tcpip-forward global request.
function SupportsDirectTcpIp(const aAddress: string; aPort : UInt32) : Boolean;
Tests whether this account may open a direct (client-to-server) TCP/IP forwarding channel to the given target address and port, matching the bits in SenderRights. The server calls it when the client requests a direct-tcpip channel.
procedure SaveToIniFile(aDest: TCustomIniFile);
Writes this account into a "UserN" section of an ini file (username, salt, verifier, iteration count, hash, subsystems, services and rights; the plain password only when SavePlainPassword is set). Used indirectly through TstSSHServerUsers.SaveToStream/Filename to persist the credential store.
procedure LoadFromIniFile(aSrc: TCustomIniFile);
Reads this account back from its "UserN" ini section, restoring the stored verifier so logins work without ever persisting the clear password (a present plain Password re-enables SavePlainPassword). The counterpart to SaveToIniFile, invoked when the store is loaded from file/stream.
property Username: string read fUsername write SetUsername;
The login name of this server account. The server resolves an incoming SSH username to a tUserItem by matching this. Set it when defining accounts in code or at design time.
property Password: string read fPassword write SetPassword;
The account password, in clear. When SavePlainPassword is True (or no verifier has been derived yet) assigning a new value clears the stored salt and PBKDF2 verifier so the next AuthPassword re-derives them; but once a verifier exists and SavePlainPassword is False, the setter treats the value as... Full description »
property SavePlainPassword: Boolean read fSavePlainPassword write SetSavePlainPassword;
When True the clear Password is written to the ini store; when False only the salt/verifier are persisted so the password never touches disk. Leave it False (the safer default) unless an app specifically needs the plain password recoverable from the saved user file.
property SubSystems: tSSHUserSubSystemOptionList read fSubSystems write SetSubSystems;
The set of SSH subsystems this account may use, as a selectable option list pre-populated from the server's registered subsystem controllers. Enable or disable individual subsystems per user here; SupportsSubSystem queries it at request time.
property ListenerRights: tListenerRights read fListenerRights write SetListenerRights;
The remote-forwarding (tcpip-forward) permissions granted to this account, as a set of address-family / localhost / any-address / privileged-port flags. Setting lrAnyPort also implies lrUnprivilegedPort and lrAnyAddress implies lrLocalhost. Consulted by SupportsTcpIpForward.
property SenderRights: tListenerRights read fSenderRights write SetSenderRights;
The direct-tcpip (client-to-server outbound) forwarding permissions for this account, using the same flag set as ListenerRights. Consulted by SupportsDirectTcpIp to decide whether an outbound tunnel is allowed.
property Services: TStrings read fServices write SetServices;
The list of named services this account is entitled to, checked by the server (via TstSSHServerUsers.AuthService) when authorising a service request from this user.

classTstSSHServerUsers — component reference

(no public members)

classtUserCollection

inherits from TOwnedCollection

constructor Create(aOwner: TstSSHServerUsers);
Constructs the user list owned by a TstSSHServerUsers component and its internal name index. Invoked internally when the owning component is created; an app obtains the ready-made collection via TstSSHServerUsers.Users rather than calling this.
destructor Destroy; override;
Frees the name-lookup index and any attached backing ini file. Internal teardown; an app does not call this directly.
function Add: tUserItem; reintroduce;
Appends a new, empty tUserItem to the collection and returns it, so an app can configure a server account in code (set Username/Password, subsystem and forwarding rights) instead of at design time. Server-side only -- this is the credential store the SSH userauth pipeline checks logins against.
procedure AddSubSystem(const aSubSystemName: string);
Grants a subsystem (e.g. "sftp") to every user in the collection at once, adding it to each item's SubSystems option list. Use to enable a subsystem server-wide without touching each account individually; if the collection is backed by an ini file the affected users are reloaded from it.
procedure RemoveSubSystem(const aSubSystemName: string);
Revokes a subsystem from every user in the collection at once. The counterpart to AddSubSystem for turning a subsystem off server-wide.
property Items[aIndex: Integer]: tUserItem read GetUser write SetUser;
Positional access to the user accounts. Use when iterating all accounts (0..Count-1), e.g. to enumerate or bulk-edit the server's users.
property Users[const aUsername: string]: tUserItem read GetUserByName;
Direct lookup of an account by its login name, returning nil when no such user exists. This is the fast path the server's password/service auth uses to resolve an incoming username to its stored credentials.

classTstSSHServerUsers — component reference

inherits from TstCustomProtoComponent

constructor Create(aOwner: TComponent); override;
Standard component constructor: seeds DefaultIter/DefaultHash with the library defaults and creates the empty Users collection. Apps normally drop this component on the same form as the server (or create it in code) and link it via the Server property rather than calling this directly. » member page
destructor Destroy; override;
Detaches from Server, so the server no longer refers to this component, and frees the Users collection. Internal teardown; an app does not call this. » member page
function AuthPassword(const aUsername, aPassword: string): Boolean; virtual;
Called server-side by the SSH userauth pipeline to verify a password login: looks up the named user and checks aPassword against that user's stored PBKDF2 verifier (or plain password). Returns False for an unknown user. Override to plug in an external credential store. Server-side only. » member page
function AuthService(const aUsername, aServiceName: string): Boolean; virtual;
Called server-side when an authenticated client requests a custom application-level SSH service: returns True when the named user's Services list contains aServiceName. Server-side only. » member page
function AuthSubSystem(const aUsername, aSubSystemName: string): Boolean; virtual;
Called server-side when a client opens a session channel and requests a subsystem (e.g. 'sftp'): returns True when the named user's SubSystems grant it. Server-side only. » member page
function AuthTcpIpForward(const aUsername: string; const aAddress : string; aPort : UInt32) : Boolean; virtual;
Called server-side when a client asks to set up remote port forwarding (tcpip-forward / OpenSSH -R) on aAddress:aPort: returns True when the named user's ListenerRights permit that bind. Server-side only. » member page
function AuthDirectTcpIp(const aUsername: string; const aAddress : string; aPort : UInt32) : Boolean; virtual;
Called server-side when a client opens a direct-tcpip channel (local forwarding / OpenSSH -L) to aAddress:aPort: returns True when the named user's SenderRights permit that target. Server-side only. » member page
procedure LoadFromStream(aSrc: TStream); virtual;
Reads the whole user database (INI text) from a stream, replacing the current Users. Use when the user list lives somewhere other than a plain Filename on disk - e.g. an encrypted blob or a database column the app decrypts into a stream at startup. » member page
procedure SaveToStream(aDst: TStream); virtual;
Writes the whole user database as INI text to a stream. Counterpart to LoadFromStream for persisting the user list somewhere other than Filename. » member page
property Server: TstCustomSSHServer read fServer write SetServer;
The SSH server this user database feeds. Assigning it wires this component as the server's user store (the server's Users property points back here) and grants every already-registered subsystem to each user. An app sets this to activate password/service/forwarding authorization. » member page
property Users: tUserCollection read fUsers write SetUsers;
The collection of user accounts (username, password verifier, permitted subsystems/services and forwarding rights). Edit at design time or populate in code to define who may log in and what each account may do. » member page
property Filename: TFilename read fFilename write SetFilename;
Path to an INI file the user database is loaded from and kept in sync with. Set it to persist accounts on disk; leave blank and use LoadFromStream/ SaveToStream to keep the list elsewhere. » member page
property DefaultIter: Integer read fDefaultIter write fDefaultIter default cDefaultVerifierIter;
Defaults for new Users entries' PBKDF2 password verifier. DefaultIter is paid server-side per password attempt - tune down for low-power servers / lower it if login latency matters; pair with login rate-limiting when set high. » member page
property DefaultHash: tHashAlgorithm read fDefaultHash write fDefaultHash default cDefaultVerifierHash;
Default hash algorithm for the PBKDF2 password verifier of new Users entries. Seeded into each account's own hash setting when the tUserItem is created (tUserItem.Create); changing it afterwards does not affect existing entries, which keep the algorithm they were created/loaded with. » member page

classTstCustomSSHServer

constructor Create(aOwner: TComponent); override;
Standard component constructor. Establishes the SSH defaults an app relies on: DefaultWindowSize 1 MB, DefaultPacketSize 32 KB and MaxChannels 16. Apps normally drop the derived TstSSHServer on a form (or create it in code) rather than calling this directly. » member page
destructor Destroy; override;
Deactivates the server and releases its peer-transport / controller lists. Internal teardown; an app does not call this directly. » member page
function StartPeerTransport(aSocket : Cardinal; aCreatePeerThread: Boolean) : iSSHServerTransport;
Entry point a socket listener calls once per accepted TCP connection: it wraps the raw socket handle in a new SSH server transport, runs the SSH handshake and user-authentication, then serves the client's channels. Full description »
procedure UnlockTransport(const aTransport: iSSHTransport);
Removes the transport from the server's active peer list and closes it. Its lock goes with the transport, when the last reference to it does. Called by the session machinery when a client session ends; an app rarely calls this directly. » member page
procedure Disconnect(aSocket: Cardinal);
Forcibly tears down the peer session currently bound to the given raw socket handle. An app calls this to drop a specific connected client (e.g. an admin "kick" action) when it still holds the socket handle it passed to StartPeerTransport. Full description »
procedure AddSubSystemController(const aController: iSSHSubSystemController);
Registers a handler for a named SSH subsystem (e.g. 'sftp'): when an authenticated client opens a session channel and requests that subsystem, the server routes it to this controller. Registering also grants the subsystem to every configured user. Call at startup to add subsystem support without subclassing the server. Server-side only. » member page
procedure RemoveSubSystemController(const aController: iSSHSubSystemController);
Unregisters a previously added subsystem controller (and revokes the subsystem from the user list). Server-side only. » member page
procedure AddListenerController(const aController: iSSHListenerController);
Registers a controller that services remote port forwarding (client "tcpip-forward" / OpenSSH -R). Apps typically add the shipped TstSSHListenerControllerSocket here to enable reverse forwarding. Server-side only. » member page
procedure RemoveListenerController(const aController: iSSHListenerController);
Unregisters a listener (remote-forward) controller. When the last controller of any kind is removed the server also goes inactive. Server-side only. » member page
procedure AddSenderController(const aController: iSSHSenderController);
Registers a controller that services local/forwarded connections (client "direct-tcpip" / OpenSSH -L). Apps typically add the shipped TstSSHSenderControllerSocket here to enable direct forwarding. Server-side only. » member page
procedure RemoveSenderController(const aController: iSSHSenderController);
Unregisters a sender (direct-tcpip) controller. When the last controller of any kind is removed the server also goes inactive. Server-side only. » member page
function IsListening(const aController: iSSHServerController): Boolean;
Returns True when the server is Active and the given controller is currently registered. An app uses this to check whether a particular forwarding/subsystem handler is live before relying on it. » member page
property KexOptions;
Ordered list of enabled key-exchange algorithms the server offers during negotiation (curve25519/ecdh/DH-group/ML-KEM hybrids). Edit at startup to restrict or reprioritise KEX for policy/interop reasons. Inherited from the base SSH component and surfaced here for the server side. » member page
property CipherC2SOptions;
Enabled client-to-server bulk ciphers, in preference order (e.g. aes*-gcm/aes*-ctr/chacha20-poly1305). Adjust to enforce a cipher policy. Inherited; C2S = data the client sends to this server. » member page
property CipherS2COptions;
Enabled server-to-client bulk ciphers, in preference order. Adjust to enforce a cipher policy. Inherited; S2C = data this server sends. » member page
property MacC2SOptions;
Enabled client-to-server MAC algorithms (ignored for AEAD ciphers that carry their own tag). Inherited. » member page
property MacS2COptions;
Enabled server-to-client MAC algorithms (ignored for AEAD ciphers). Inherited. » member page
property CompressionC2SOptions;
Enabled client-to-server compression methods (none / zlib). Inherited. » member page
property CompressionS2COptions;
Enabled server-to-client compression methods (none / zlib). Inherited. » member page
property ServerKeyOptions;
Ordered list of enabled host-key (server public-key) algorithms the server advertises. Only algorithms for which a matching Server*Key is assigned are actually usable. Inherited. » member page
property ServerDSSKey;
The server's DSA (ssh-dss) host key. Assign a TstCustomMPKey holding the private host key to offer ssh-dss authentication of the server to clients; leave nil to not offer DSA. Server-side only. » member page
property ServerDSSKeyIdentifier;
When ServerDSSKey is a key-manager/container holding several keys, names which entry to use as the DSA host key. Server-side only. » member page
property ServerRSAKey;
The server's RSA (ssh-rsa / rsa-sha2-*) host key. Assign the private host key to offer RSA host authentication (the most widely interoperable choice). Server-side only. » member page
property ServerRSAKeyIdentifier;
Selects which entry to use as the RSA host key when ServerRSAKey is a multi-key container. Server-side only. » member page
property ServerEdDSAKey;
The server's Ed25519/Ed448 (ssh-ed25519) host key. Assign to offer EdDSA host authentication. Server-side only. » member page
property ServerEdDSAKeyIdentifier;
Selects which entry to use as the EdDSA host key when ServerEdDSAKey is a multi-key container. Server-side only. » member page
property ServerECDSAKey;
The server's ECDSA (ecdsa-sha2-nistp*) host key. Assign to offer ECDSA host authentication. Server-side only. » member page
property ServerECDSAKeyIdentifier;
Selects which entry to use as the ECDSA host key when ServerECDSAKey is a multi-key container. Server-side only. » member page
property VersionServer;
The SSH version/software identification string this server sends in its banner. Set to customise or mask the advertised implementation. Inherited; this is the server's own banner (the peer's is VersionClient on the base). » member page
property MaxChannels;
Maximum number of simultaneously open channels allowed per client session (default 16). Raise for clients that multiplex many forwards/sessions. Inherited. » member page
property DefaultWindowSize;
Default flow-control receive-window size (bytes) advertised for new channels (default 1 MB). Larger windows improve throughput on high-latency links at the cost of memory. Inherited. » member page
property DefaultPacketSize;
Default maximum SSH packet payload size (bytes) for new channels (default 32 KB). Inherited. » member page
property LoginGraceTime: Cardinal read fLoginGraceTime write fLoginGraceTime default cSSHLoginGraceTimeMSec;
Milliseconds a client has to log in, counted from the moment the server takes its connection on (default 120000, the default of OpenSSH's LoginGraceTime). Full description »
property Active: Boolean read GetActive write SetActive default False;
Server "running" flag; toggle it to start/stop the listener. Runtime reads and writes go through the virtual IntGetActive/IntSetActive, which descendants override to define what "active" means. Full description »
property IsGlobalServer: Boolean read GetIsGlobalServer write SetIsGlobalServer;
Marks this instance as the process-wide global SSH server. Setting True stores Self in the module-level singleton returned by SSHGlobalServer; setting False clears it. Full description »
property ClientKeys: TstCustomMPKey read fClientKeys write SetClientKeys;
Key store used to verify clients' public keys during 'publickey' authentication: on each attempt the server looks up the offered key by the client's username (via iGetRSAKey/iGetDSSKey) and validates the signature. Assign a TstCustomMPKey key manager holding the authorized client keys to enable public-key logon. Server-side only. » member page
property UserAuthOptions: tSSHServerUserAuthOptionList read fUserAuthOptions write SetUserAuthOptions;
Configures which user-authentication methods the server accepts and in what order. The shipped defaults are 'password' and 'publickey'; the 'none' method is always handled (used for the initial method-probe). An app tunes this to set its authentication policy. Server-side only. » member page
property Users: TstSSHServerUsers read fUsers;
Optional user database component driving password/subsystem/forwarding authorization. When assigned, the server consults it (AuthPassword, AuthSubSystem, AuthTcpIpForward, AuthDirectTcpIp, AuthService) before the corresponding On* events fire. Read-only here - link a TstSSHServerUsers by setting its Server property. Server-side only. » member page
property OnSetClientPassword: tSetClientPasswordEvent read fOnSetClientPassword write SetOnSetClientPassword;
Password-authentication hook. Fires during 'password' auth with the offered username/password; set aOK to accept or reject. Runs after any Users check, so an app uses it to add or override password validation (and to drive a forced password change via aChange). If neither Users nor this handler is assigned, password auth raises. Server-side only. » member page
property OnAuthSubSystem: tAuthSubSystemEvent read fOnAuthSubSystem write SetOnAuthSubSystem;
Authorization hook fired when an authenticated client requests a subsystem; set aOK to allow or deny. Runs after the Users.AuthSubSystem check, letting an app apply per-user subsystem policy. Server-side only. » member page
property OnBeginSubSystemThread: TNotifyEvent read fOnBeginSubSystemThread write SetOnBeginSubSystemThread;
Fires at the start of a subsystem worker thread (before it processes requests). Use it to initialise thread-local state - e.g. attach a database connection or call CoInitialize for a COM-based subsystem. Server-side only. » member page
property OnEndSubSystemThread: TNotifyEvent read fOnEndSubSystemThread write SetOnEndSubSystemThread;
Fires as a subsystem worker thread ends. Use it to release whatever OnBeginSubSystemThread set up. Server-side only. » member page
property OnAuthTcpIPForward: tAuthTcpIpForwardEvent read fOnAuthTcpIPForward write SetOnAuthTcpIPForward;
Authorization hook for a client's remote-forward ("tcpip-forward" / -R) request to have the server listen on an address/port; set aOK to allow. Runs after Users.AuthTcpIpForward. Use it to control which bind addresses/ports a client may open. Server-side only. » member page
property OnAuthDirectTcpIP: tAuthTcpIpForwardEvent read fOnAuthDirectTcpIP write SetOnAuthDirectTcpIP;
Authorization hook for a client's direct-forward ("direct-tcpip" / -L) channel to a target address/port; set aOK to allow. Runs after Users.AuthDirectTcpIp. Use it to restrict which onward hosts/ports a client may reach. Server-side only. » member page
property OnBeforeSendIgnore: tBeforeSendIgnoreEvent read fBeforeSendIgnore write SetBeforeSendIgnore;
Asks whether to send an SSH_MSG_IGNORE, a keep-alive/traffic-masking packet, on a connection that has nothing to read; set aSendIt and aLength to control whether and how much padding is sent. Full description »
property OnUnauthenticatedServiceRequest: tAuthenticateServiceRequestEvent read fOnUnauthenticatedServiceRequest write SetOnUnauthenticatedServiceRequest;
Fires when a service is requested before user authentication (normally only 'ssh-userauth'); set aAllowed to accept a service on the unauthenticated connection. Rarely needed - use only to permit a custom pre-auth service. Server-side only. » member page
property OnAuthenticatedServiceRequest: tAuthenticateServiceRequestEvent read fOnAuthenticatedServiceRequest write SetOnAuthenticatedServiceRequest;
Fires when an authenticated client requests a service other than the built-in 'ssh-connection'; set aAllowed to grant it. Runs after Users.AuthService. Use it to authorize a custom application-level service. Server-side only. » member page
property OnExecuteCustomService: tServiceExecuteEvent read fOnExecuteCustomService write SetOnExecuteCustomService;
Fires to actually run a custom (non-'ssh-connection') service that was authorized: the app implements the service protocol over aTransport here, and sets aAsynch=True if it takes ownership on its own thread. Server-side only. » member page

classTstSSHServer — component reference

inherits from TstCustomSSHServer

property OnRawAccept;
Fires once per inbound TCP connection the server accepts, before the SSH handshake starts. This is the server-side counterpart to the client's OnRawConnect. Use it to note a new peer socket is up (connection logging, per-connection accounting, or admission control) independently of the client completing authentication. » member page
property OnRawClose;
Fires when an accepted peer socket closes, whether from a clean session end, an explicit Disconnect, or a transport failure. Use it to react to a client dropping (update a connected-clients count or UI, release per-connection resources). » member page
property OnRawRecvLength;
Fires when the server asks a peer socket how many bytes are available to read without blocking. Of interest mainly for the same raw-traffic instrumentation as OnRawSend/OnRawRecv; ordinary application code rarely needs it. A handler that provides the socket sets aResult negative once the connection has ended with nothing left to read, so the server ends that connection instead of waiting on it. » member page
property OnRawRecv;
Fires after each raw byte receive on a peer's underlying TCP socket. Together with OnRawSend this lets an app observe or capture the raw encrypted SSH stream per connection, e.g. for logging or a traffic monitor. » member page
property OnRawSend;
Fires after each raw byte send on a peer's underlying TCP socket. Useful to log, meter, or packet-capture the encrypted SSH wire traffic (bandwidth accounting or transport troubleshooting) without parsing SSH framing. » member page

Types (enumerations, sets, aliases)

proctSetClientPasswordEvent

  tSetClientPasswordEvent = procedure (Sender   : TObject;
                                 const aUsername: string;
                                 const aService : string;
                                   var aChange  : Boolean;
                                 const aPassword: string;
                                   var aOK      : Boolean) of object;

proctAuthSubSystemEvent

  tAuthSubSystemEvent = procedure (Sender    : TObject;
                             const aUsername : string;
                             const aSubSystem: string;
                               var aOK       : Boolean) of object;

proctAuthTcpIpForwardEvent

  tAuthTcpIpForwardEvent = procedure (Sender  : TObject;
                                const aAddress: string;
                                      aPort   : UInt32;
                                  var aOK     : Boolean) of object;

enumtListenerRight

  tListenerRight = (lrIPv4,lrIPv6,lrUnprivilegedPort,lrLocalhost,lrAnyPort,lrAnyAddress);

settListenerRights

  tListenerRights = set of tListenerRight;

proctBeforeSendIgnoreEvent

  tBeforeSendIgnoreEvent = procedure (Sender         : TObject;
                                const aTransport     : iSSHTransport;
                                      aTicksSinceLast: Cardinal;
                                  var aLength        : Integer;
                                  var aSendIt        : Boolean) of object;

proctAuthenticateServiceRequestEvent

  tAuthenticateServiceRequestEvent = procedure (Sender      : TObject;
                                          const aTransport  : iSSHTransport;
                                          const aServiceName: string;
                                          const aUsername   : string;
                                            var aAllowed    : Boolean) of object;

proctServiceExecuteEvent

  tServiceExecuteEvent = procedure (Sender      : TObject;
                              const aTransport  : iSSHTransport;
                              const aServiceName: string;
                                var aAsynch      : Boolean) of object;

Routines