SV-258129r1155628_rule
V-258129
SRG-OS-000080-GPOS-00048
RHEL-09-611200
CAT II
10
Configure RHEL 9 to require authentication for single-user mode.
Create a directory for supplementary configuration files:
$ sudo mkdir /etc/systemd/system/rescue.service.d/
Copy the original file rescue.service file to the new directory with:
$ sudo cp /usr/lib/systemd/system/rescue.service /etc/systemd/system/rescue.service.d/rescue.service.conf
Open the new file:
$ sudo vi etc/systemd/system/rescue.service.d/rescue.service.conf
Add this line to the new file:
ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue
Comment out or remove the ExecStart and ExecStartPre lines in /usr/lib/systemd/system/rescue.service as they can only exist in one location.
Apply changes to unit files without rebooting the system:
$ sudo systemctl daemon-reload
Verify RHEL 9 requires authentication for single-user mode with the following command:
$ grep sulogin /usr/lib/systemd/system/rescue.service
ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue
If the line is not returned from the default systemd file, use the following command to look for modifications to the rescue.service:
$ grep sulogin /etc/systemd/system/rescue.service.d/*.conf
If the line is not returned from either location this is a finding.
Note: The configuration setting can only be in either the default location, or in the drop in file, not both locations.
V-258129
False
RHEL-09-611200
Verify RHEL 9 requires authentication for single-user mode with the following command:
$ grep sulogin /usr/lib/systemd/system/rescue.service
ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue
If the line is not returned from the default systemd file, use the following command to look for modifications to the rescue.service:
$ grep sulogin /etc/systemd/system/rescue.service.d/*.conf
If the line is not returned from either location this is a finding.
Note: The configuration setting can only be in either the default location, or in the drop in file, not both locations.
M
5551