5.1.26 Ensure sshd ClientAliveInterval is configured

Information

The SSH daemon must be configured with a timeout interval.

Terminating an idle SSH session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle SSH session will also free up resources committed by the managed network element.

Terminating network connections associated with communications sessions includes, for example, de-allocating associated TCP/IP address/port pairs at the operating system level and de-allocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean that the operating system terminates all sessions or network access; it only ends the inactive session and releases the resources associated with that session.

RHEL 8 operating systems utilize "/etc/ssh/sshd_config" for configurations of OpenSSH. Within the sshd_config the product of the values of "ClientAliveInterval" and "ClientAliveCountMax" are used to establish the inactivity threshold. The "ClientAliveInterval" is a timeout interval in seconds after which if no data has been received from the client, sshd will send a message through the encrypted channel to request a response from the client. The "ClientAliveCountMax" is the number of client alive messages that may be sent without sshd receiving any messages back from the client. If this threshold is met, sshd will disconnect the client. For more information on these settings and others, refer to the "sshd_config" man pages.

Satisfies: SRG-OS-000163-GPOS-00072, SRG-OS-000126-GPOS-00066, SRG-OS-000279-GPOS-00109

Solution

Edit the /etc/ssh/sshd_config file to set the ClientAliveInterval parameter to a value of 600 or less above any Include and Match entries as follows:

ClientAliveInterval 600

Note: First occurrence of a option takes precedence, Match set statements withstanding. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location.

In order for the changes to take effect, the SSH daemon must be restarted.

# systemctl reload-or-restart sshd.service

See Also

https://workbench.cisecurity.org/benchmarks/19886

Item Details

Category: SYSTEM AND COMMUNICATIONS PROTECTION

References: 800-53|SC-10, CSCv7|16.11

Plugin: Unix

Control ID: 4138f0a8c9ccf89e1499d5462f1b51008d94ed87185e4226612b0a0f80450dbc