0

The default value of ExecStart in /lib/systemd/system/rescue.service is:

ExecStart=-/bin/sh -c "/sbin/sulogin; /bin/systemctl --job-mode=fail --no-block default"

This doesn't work if your root account is locked --- it'll give this error:

Cannot open access to console, the root account is locked.
See sulogin(8) man page for more details.
Press Enter to continue.

Instead, I want it to drop to the shell of a regular user that has sudo as root privileges.

This is what I have done:

# we don't want to edit the main file
# so make a copy in /etc and edit it there
cp /lib/systemd/system/rescue.service /etc/systemd/system/rescue.service 

# then change the ExecStart line to look like this
ExecStart=-/bin/sh -c "/bin/su - homie; /bin/systemctl --job-mode=fail --no-block default"

I am testing this by powering off an external USB drive and and booting. It'll go into rescue mode but it still give that same above error.

What am I doing wrong?

And yes, I know I can use the --force option of /sbin/sulogin to force it to open a root shell even if the root account is locked but I do not want to do this for security reasons. I want it to drop to a regular user shell.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.