1.5.3 Ensure authentication required for single user mode

Warning! Audit Deprecated

This audit has been deprecated and will be removed in a future update.

View Next Audit Version

Information

Single user mode (rescue mode) is used for recovery when the system detects an issue during boot or by manual selection from the bootloader.

Requiring authentication in single user mode (rescue mode) prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials.

Solution

Edit /usr/lib/systemd/system/rescue.service and add/modify the following line:

ExecStart=-/bin/sh -c "/usr/sbin/sulogin; echo 'Starting default target'; /usr/bin/systemctl --job-mode=fail --no-block default"

Edit /usr/lib/systemd/system/emergency.service and add/modify the following line:

ExecStart=-/bin/sh -c "/usr/sbin/sulogin; echo 'Starting default target'; /usr/bin/systemctl --job-mode=fail --no-block default"

After modifying the systemd service files run the following command to reload the systemd manager configuration to apply the changes:

# systemctl daemon-reload

See Also

https://workbench.cisecurity.org/benchmarks/8658