SV-270742r1066715_rule
V-270742
SRG-OS-000163-GPOS-00072
UBTU-24-600000
CAT II
10
Configure Ubuntu 24.04 LTS to automatically terminate inactive SSH sessions after a period of inactivity.
Modify or append the following line in the "/etc/ssh/sshd_config" file, replacing "[Count]" with a value of 1:
ClientAliveCountMax 1
Restart the SSH daemon for the changes to take effect:
$ sudo systemctl restart ssh.service
Verify that all network connections associated with SSH traffic automatically terminate after a period of inactivity with the following command:
$ sudo grep -ir ClientAliveCountMax /etc/ssh/sshd_config*
/etc/ssh/sshd_config:ClientAliveCountMax 1
If "ClientAliveCountMax" is not to "1", if conflicting results are returned, is commented out, or is missing, this is a finding.
V-270742
False
UBTU-24-600000
Verify that all network connections associated with SSH traffic automatically terminate after a period of inactivity with the following command:
$ sudo grep -ir ClientAliveCountMax /etc/ssh/sshd_config*
/etc/ssh/sshd_config:ClientAliveCountMax 1
If "ClientAliveCountMax" is not to "1", if conflicting results are returned, is commented out, or is missing, this is a finding.
M
5673