Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

propertyTstCustomSSHServer.LoginGraceTime

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). 0 is no limit.

The limit is for the whole login: the version strings, the key exchange, the service request and user authentication. Until it runs out, the server waits for the client's next message for as long as that takes - a person may be at the other end, checking the server's host key before the client sends NEWKEYS, or typing a user name or a password. Messages that are skipped, such as SSH_MSG_IGNORE, do not extend it. When it runs out while the server is waiting, the server sends SSH_MSG_DISCONNECT (reason 10, connection lost) and closes the connection. The wait for the client's version string also has a limit of its own, 30,000 tries of a millisecond or more, and ends at whichever comes first.

Once the client has logged in, the limit no longer applies: in a later key exchange the server waits about 5 s for each message. A connection that the client closes, or that is reset, is noticed at once whatever the limit. Disconnect, freeing the server and deactivating a TstSSHSocketServer with CloseAllOnDeactivate end a login under way within about 0.1 s while the server waits for the client, or else once the step under way is done - checking a password or a key, or an event handler.

Each connection has a thread of its own, so a lower limit frees the threads of connections that never log in sooner. A change applies to connections taken on after it. Server-side only.