1

Context: Ubuntu user considering moving to Debian so trying some test installs.

In Ubuntu you could choose the advanced options from the grub menu, select recovery mode, and if friendly-recovery was installed, enable networking and drop to a root shell to fix things.

I just tried this in my test Debian install, and it didn't work because "the root user is locked". I thought the root user was locked in Ubuntu as well, but apparently this is something more restrictive.

How can I get recovery mode to work in Debian 11?

2 Answers2

3

You can append rw init=/bin/bash to your kernel boot parameters or boot from the Debian USB installer in "Rescue Mode" (Advanced options->Rescue mode) and drop to a root shell with network even if the root account is locked. You need to know the partition of your root filesystem.

I can confirm that friendly-recovery doesn't work with a locked root account, I get

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

Press enter to continue

If the account is not locked, you still need to enter the password.

Freddy
  • 25,565
1

Following up on the comment from Jaromanda X, it appears that the easiest way to enable friendly-recovery is to set a root password with sudo passwd root.

This doesn't seem to be quite the way Ubuntu does it - when I drop to a root shell in friendly-recovery in Ubuntu, it does not prompt you for a password, whereas Debian does - so I am still looking into it, but this is acceptable for now.

I would still eagerly receive answers on what the difference with the Ubuntu implementation is.