In this tutorial, we have demonstrated the guidelines for resetting the root password in Debian 11.
How to Reset Forgotten Root Password in Debian 11
Here are the steps to reset the forgotten root password in Debian 11:
Step 1: First, you must access the Grub Menu to reset the forgotten root password in Debian 11. Restart the system and press the shift key while restarting the device.
Step 2: The next step is to edit the grub menu, and press the e key when this screen appears:
Step 3: Use the arrow keys to move up and down on the editing screen. Scroll down the menu until you move to the line that starts with Linux. Look at the end of this line you will find ro quiet, you have to edit this string.
Step 4: Replace the string with init=/bin/bash at the end of the line as shown in the screenshot:
Step 5: Next, you have the root access of the Debian system, mount the root file system with the read and write permission by executing the following command:
Step 6: Now change the root password via the following command:
Step 7: Enter the new password twice and hit Enter. The message will pop up “Password updated successfully”:
Step 8: Exit the single-user mode and reboot the system normally. You can now log in with your new root password on Debian.
Bottom Line
Resetting a forgotten password in Debian 11 isn’t a simple task. However, the users can follow the step-by-step guidelines presented in this article to quickly reset the forgotten root password in Debian. Make sure to write the updated password somewhere so that you don’t need to reset the password again.