STIGUI
V-238218CAT I — High severitySV-238218r991591_rule

The Ubuntu operating system must not allow unattended or automatic login via SSH.

Rule version UBTU-20-010047 · STIG v2 · 2025-05-16

Discussion

Failure to restrict system access to authenticated users negatively impacts Ubuntu operating system security.

Check

Verify that unattended or automatic login via SSH is disabled with the following command:

$ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\r' | tr '\n' ' ' | xargs sudo grep -iEH '^\s*(permit(.*?)(passwords|environment))'

PermitEmptyPasswords no PermitUserEnvironment no

If "PermitEmptyPasswords" or "PermitUserEnvironment" keywords are not set to "no", are missing completely, or are commented out, this is a finding.

If conflicting results are returned, this is a finding.

Fix

Configure the Ubuntu operating system to allow the SSH daemon to not allow unattended or automatic login to the system.

Add or edit the following lines in the "/etc/ssh/sshd_config" file:

PermitEmptyPasswords no PermitUserEnvironment no

Restart the SSH daemon for the changes to take effect:

$ sudo systemctl restart sshd.service

Identifiers

Group ID
V-238218
Group title
SRG-OS-000480-GPOS-00229
Rule ID
SV-238218r991591_rule
Check ID
C-41428r951478_chk
Fix ID
F-41387r653828_fix