SV-261331r996459_rule
V-261331
SRG-OS-000163-GPOS-00072
SLEM-05-255030
CAT II
10
Add or modify the following line in the "/etc/ssh/sshd_config" file:
ClientAliveCountMax 1
Restart the SSH daemon for the changes to take effect:
> sudo systemctl restart sshd.service
Verify the SSH server automatically terminates a user session after the SSH client has become unresponsive by using the following command:
> sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\r' | tr '\n' ' ' | xargs sudo grep -iH '^\s*clientalivecountmax'
/etc/ssh/sshd_config:ClientAliveCountMax 1
If "ClientAliveCountMax" is not set to "1", is commented out, missing, or conflicting results are returned, this is a finding.
V-261331
False
SLEM-05-255030
Verify the SSH server automatically terminates a user session after the SSH client has become unresponsive by using the following command:
> sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\r' | tr '\n' ' ' | xargs sudo grep -iH '^\s*clientalivecountmax'
/etc/ssh/sshd_config:ClientAliveCountMax 1
If "ClientAliveCountMax" is not set to "1", is commented out, missing, or conflicting results are returned, this is a finding.
M
5596