Reset your forgotten root password for Debian 11 Bullseye server or desktop by resetting it. Here are the commands to follow for that.
Forgotten passwords are always annoying – especially when it comes to your computer password. So you can no longer access your important data.
Among the numerous tasks that we have to carry out every day when managing Linux operating systems is resetting the password of the users, whether they are logged in or not, to regain access to the system and make it work properly. However, being an administrator you need root user access for that. But what happens if you forget the root password? In such conditions, you won’t be able to perform the core tasks of your computer. This problem often occurs because users use multiple passwords on multiple platforms. So, here is the solution to that.
Steps to reset forgotten root password on Debian 11
To reset the password, first, we have to access the Grub menu of our Debian 11 Bullseye. Restart your system and while doing that press and hold the Shift key on your Keyboard. This will drop you into the Grub menu of Debian 11.
2. Edit Gurb Menu to Reset the root password
The next step is to edit the default boot entry of your Debian 11. For that 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.
3. Add rw init=/bin/bash
On the Grub editing screen, use your arrow key and move to the end of the line starting with “Linux“. There at end of this line type – rw init=/bin/bash
, as shown in the given screenshot.
rw init=/bin/bash
After adding the given syntax, next, boot your system with this configuration. For that either use Ctrl+X or F10.
4. Debian 11 Root shell Access
Now, without providing any password you will have Debian 11’s shell with root access. Here, first, let’s check whether our user has read and write access to the file system where the OS has been installed.
For that use the command:
mount | grep -w /
If the output is:
(rw,realtime
) then it means you have real-time- read and write access to the file system.
5. Reset the root user password
Now, let’s change the password as we do normally on a Linux system using the command terminal.
Type:
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. For example, if our system user name is Debian and we want to change the password of that then the command will be:
Syntax:
passwd username
example:
passwd debian
6. Reboot your system
Once you are done resetting your Linux password then restart your system to log in with the changed password. For rebooting, type:
exec /sbin/init
And that hit the Enter key.
From here onwards, you can log in and access your system with the newly set root password. This guide would be useful for those who somehow lose or forgot the root password and now want to change the same. The steps given in this article will also work for other Debian 11 versions as well.
Other Articles:
• Install PowerShell on Debian 11 Bullseye Linux
• Install phpBB forum on Debian 11 Bullseye
• How to install Telegram on Debian 11 Bullseye
• Forgot Your Linux Mint password- Here is a way to recover it.
It worked! I reset both my root and my user passwords!
omg mindblown
Hi,
Before all – cheers fot this – ,
second I believe in one typo:
the (password, realtime) you mention is
in fact (password, relatime).
With a human’s cheers for standing with Humanity.