SV-269376r1050259_rule
V-269376
SRG-OS-000109-GPOS-00056
ALMA-09-034780
CAT II
10
To configure the system to prevent users from logging on directly as root over SSH, add or modify the following line in "/etc/ssh/sshd_config":
PermitRootLogin no
Alternatively, add the setting to an include file if the line "Include /etc/ssh/sshd_config.d/*.conf" is found at the top of the "/etc/ssh/sshd_config" file:
$ echo "PermitRootLogin no" > /etc/ssh/sshd_config.d/root.conf
Restart the SSH daemon for the settings to take effect:
$ systemctl restart sshd.service
Verify AlmaLinux OS 9 prevents users from logging on directly as "root" over SSH with the following command:
$ sshd -T |grep -I permitrootlogin
permitrootlogin no
If the "PermitRootLogin" keyword is set to "yes" or "without-password", this is a finding.
V-269376
False
ALMA-09-034780
Verify AlmaLinux OS 9 prevents users from logging on directly as "root" over SSH with the following command:
$ sshd -T |grep -I permitrootlogin
permitrootlogin no
If the "PermitRootLogin" keyword is set to "yes" or "without-password", this is a finding.
M
5664