SV-260526r1208678_rule
V-260526
SRG-OS-000480-GPOS-00229
UBTU-22-255025
CAT I
10
Configure the SSH server to not allow unattended or automatic login to the system.
Add or modify the following lines in the "/etc/ssh/sshd_config" file:
PermitEmptyPasswords no
PermitUserEnvironment no
Restart SSH for the changes to take effect:
$ sudo systemctl restart ssh
Verify that unattended or automatic login via SSH is disabled by using the following command:
$ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\r' | tr '\n' ' ' | xargs sudo grep -iEH '(permit(.*?)(passwords|environment))'
/etc/ssh/sshd_config:PermitEmptyPasswords no
/etc/ssh/sshd_config:PermitUserEnvironment no
If "PermitEmptyPasswords" and "PermitUserEnvironment" are not set to "no", are commented out, are missing, or conflicting results are returned, this is a finding.
V-260526
False
UBTU-22-255025
Verify that unattended or automatic login via SSH is disabled by using the following command:
$ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\r' | tr '\n' ' ' | xargs sudo grep -iEH '(permit(.*?)(passwords|environment))'
/etc/ssh/sshd_config:PermitEmptyPasswords no
/etc/ssh/sshd_config:PermitUserEnvironment no
If "PermitEmptyPasswords" and "PermitUserEnvironment" are not set to "no", are commented out, are missing, or conflicting results are returned, this is a finding.
M
5594