Reset Linux Root Password on Debian 12 Bookworm

This tutorial intends to teach you to Reset the Linux Root Password on Debian 12 Bookworm. For some reason, may the superuser or root user forgot his password. So they must recover the lost password prior to booting into the login screen. You can proceed to the following steps to see how to recover or reset the root password on Debian 12 from the Grub menu.

How To Reset Linux Root Password on Debian 12 Bookworm?

To start the recovery root password process, you must restart your Debian server. Once the system is restarted, press and hold the Shift key on your Keyboard. This will drop you into the Grub menu.

Then, proceed to the following steps to complete this guide.

Recover the Root Password from the Grub Menu on Debian 12

At this point, you need to press the ‘e’ key on your keyboard. This will let you edit the Grub’s boot prompt. Don’t touch or delete anything here. Once you have the editor move to the next step.

Debian 12 Grub Menu

At this point, use your arrow key and move to the end of the line starting with “Linux“. Then, at the end of this line, you should type rw init=/bin/bash.

rw init=/bin/bash
Edit Debian 12 Grub menu to reset root password

After adding the syntax, boot your system with this configuration. To do this, you can use Ctrl+X or F10.

Root Shell Access on Debian 12

At this point, without providing any password you will have Debian 12’s shell with root access. First, let’s check whether your user has read and write access to the file system where the OS has been installed.

To do this, run the following command:

mount | grep -w /

If you see (rw,realtime) in your output, it means you have real-time read and write access to the file system.

Change Root Pass on Debian 12

Now you can simply change your root password on Debian 12 with the following command:

passwd

The system will prompt you to add a new password two times.

To change the password of some other user than root, we have to mention the username of the same. The syntax is like the following command:

passwd username

When you are done resetting your Linux password, restart your system to log in with the changed password. For rebooting, run the command below:

exec /sbin/init

After that, hit the Enter key.

From here, you can log in and access your system with the newly set root password.

That’s it, you are done.

Conclusion

The only way to recover your root user access is by resetting the password manually. At this point, you have learned to Reset the Linux Root Password on Debian 12 Bookworm from the Grub Menu.

Hope you enjoy it. You may be like these articles on the Orcacore website:

How To Change SSH Port on Debian

How To Check HTTPS Port 443 is Open on Linux

Fix error Group ‘development-tools’ is not available

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!