SV-260527r1208681_rule
V-260527
SRG-OS-000126-GPOS-00066
UBTU-22-255030
CAT II
10
Configure the SSH server to terminate a user session automatically after the SSH client has become unresponsive.
Note: This setting must be applied in conjunction with UBTU-22-255040 to function correctly.
Add or modify the following line in the "/etc/ssh/sshd_config" file:
ClientAliveCountMax 1
Restart SSH for the changes to take effect:
$ sudo systemctl restart ssh
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 'clientalivecountmax'
/etc/ssh/sshd_config:ClientAliveCountMax 1
If "ClientAliveCountMax" is not set to "1", conflicting results are returned, or it is commented out or missing, this is a finding.
V-260527
False
UBTU-22-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 'clientalivecountmax'
/etc/ssh/sshd_config:ClientAliveCountMax 1
If "ClientAliveCountMax" is not set to "1", conflicting results are returned, or it is commented out or missing, this is a finding.
M
5594