


Method 1ġ.Configure the timeout value in the /etc/ssh/sshd_config file with below parameter values. For example in this post we will configure an auto logout interval of 10 mins. There are 2 methods to configure the inactivity timeout. This option applies to protocol version 2 only. The default is 0, indicating that these messages will not be sent to the client. Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the encrypted channel to request a response from the client. If ClientAliveInterval (see below) is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds. The client alive mechanism is valuable when the client or server depend on knowing when a connection has become inactive. The TCP keepalive option enabled by TCPKeepAlive is spoofable. The client alive messages are sent through the encrypted channel and therefore will not be spoofable. If the desktop pool or machine is configured to log off automatically after a disconnect, then that setting will be honored. If disabled, unconfigured, or enabled with the setting Never, then the desktop sessions will never be disconnected. It is important to note that the use of client alive messages is very different from TCPKeepAlive (below). Specifies the amount of time after which a desktop session will disconnect due to user inactivity. As soon as the user clicks OK, the Logon Timer Expired message appears. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. As soon as User3 starts a remote session to Server 2, the Idle Timer Expired message appears. Sets the number of client alive messages (see below) which may be sent without sshd(8) receiving any messages back from the client.
