5.2.22 Ensure SSH Idle Timeout Interval is configured
Audit#
Run the following commands and verify ClientAliveInterval is greater than zero:
# sshd -T -C user=root -C host="$(hostname)" -C addr="$(grep $(hostname) /etc/hosts | awk '{print $1}')" | grep clientaliveinterval
Example output:
Run the following command and verify ClientAliveCountMax is greater than zero:
# sshd -T -C user=root -C host="$(hostname)" -C addr="$(grep $(hostname) /etc/hosts | awk '{print $1}')" | grep clientalivecountmax
Example output:
Remediation#
Edit the /etc/ssh/sshd_config file to set the parameters according to site policy.
Example:
Default Value:
ClientAliveInterval 0
ClientAliveCountMax 3