SV-257996r1134915_rule
V-257996
SRG-OS-000126-GPOS-00066
RHEL-09-255100
CAT II
10
Note: This setting must be applied in conjunction with RHEL-09-255095 to function correctly.
Configure the SSH server to terminate a user session automatically after the SSH client has been unresponsive for 10 minutes.
Modify or append the following lines in the "/etc/ssh/sshd_config" or in a file in "/etc/ssh/sshd_config.d":
ClientAliveInterval 600
For the changes to take effect, the SSH daemon must be restarted.
$ sudo systemctl restart sshd.service
Verify the "ClientAliveInterval" variable is set to a value of "600" or less by performing the following command:
$ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\r' | tr '\n' ' ' | xargs sudo grep -iH '^\s*clientaliveinterval'
/etc/ssh/sshd_config.d/ClientAliveInterval.conf:ClientAliveInterval 600
Verify the runtime value of "ClientAliveInterval" with the following command:
$ sudo sshd -T | grep -i clientaliveinterval
clientaliveinterval 600
If "ClientAliveInterval" does not exist, does not have a value of "600" or less in "/etc/ssh/sshd_config", or is commented out, this is a finding.
V-257996
False
RHEL-09-255100
Verify the "ClientAliveInterval" variable is set to a value of "600" or less by performing the following command:
$ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\r' | tr '\n' ' ' | xargs sudo grep -iH '^\s*clientaliveinterval'
/etc/ssh/sshd_config.d/ClientAliveInterval.conf:ClientAliveInterval 600
Verify the runtime value of "ClientAliveInterval" with the following command:
$ sudo sshd -T | grep -i clientaliveinterval
clientaliveinterval 600
If "ClientAliveInterval" does not exist, does not have a value of "600" or less in "/etc/ssh/sshd_config", or is commented out, this is a finding.
M
5551