SV-274049r1120747_rule
V-274049
SRG-OS-000109-GPOS-00056
AZLX-23-001240
CAT II
10
Configure Amazon Linux 2023 to prevent SSH users from logging on directly as root add or modify the following line in "/etc/ssh/sshd_config" or in a file in "/etc/ssh/sshd_config.d".
PermitRootLogin no
Restart the SSH daemon for the settings to take effect:
$ sudo systemctl restart sshd.service
Verify Amazon Linux 2023 remote access using SSH prevents users from logging on directly as "root" with the following command:
$ sudo grep -ir PermitRootLogin /etc/ssh/sshd_config /etc/ssh/sshd_config.d/
/etc/ssh/sshd_config:PermitRootLogin no
If the "PermitRootLogin" keyword is set to "yes", is missing, or is commented out, this is a finding.
V-274049
False
AZLX-23-001240
Verify Amazon Linux 2023 remote access using SSH prevents users from logging on directly as "root" with the following command:
$ sudo grep -ir PermitRootLogin /etc/ssh/sshd_config /etc/ssh/sshd_config.d/
/etc/ssh/sshd_config:PermitRootLogin no
If the "PermitRootLogin" keyword is set to "yes", is missing, or is commented out, this is a finding.
M
5700