Well, guys, we have successfully changed our current root Debian 12 Linux password without knowing the old one. Let’s now restart the system properly. For that execute the given command on your terminal.
exec /sbin/init
Reset your forgotten root password for Debian 11 Bullseye server or desktop. Here are the commands to do so.
Forgotten passwords are usually inconvenient, especially when it comes to your computer password. As a result, you can no longer access your critical data.
Apart from that, losing access to the root account will also limit your access to perform system-critical tasks. Even modifying systems files and configuration will be limited. Well, I can understand the pain, and that’s why here in this article we will discuss the process of resetting the root password in Debian 12 Linux. So, that you can get back full control over your server or desktop.
A step-by-step guide to resetting the forgotten root password of Debian 12.
To reset the root password, first of all, we restart our Debian 12 system or virtual machine we are using. Soon as the system restarted, it will show you the Grub menu for a few seconds to select the advanced option. Press any arrow key to stop the system from further processing.
In this tutorial, we have demonstrated the guidelines for resetting the 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 7: Enter the new password twice and hit Enter. The message will pop up “Password updated successfully”:
Bottom Line
About the author
So, first power on or reboot your Debian 10 system. You should be presented with a GRUB menu as shown below. On the first option, proceed and press the ‘e’ key on the keyboard before the system starts booting.
Debian Grub Menu
This ushers you to the screen shown below. Scroll down and locate the line that begins with ‘linux’ that precedes the /boot/vmlinuz-* section that also specifies the UUID.
Grub Kernel Parameters
Move the cursor to the end of this line, just after ‘ro quiet’ and append the parameter init=/bin/bash.
For you to reset the password, you need to change the access right from read-only to read-write. Therefore, run the command below to remount the root filesystem with rw attributes.
:/# mount -n -o remount,rw /
Mount Debian Filesystem
Next, reset the root password by executing the good old passwd command as shown.
:/# passwd
Reset Root Password in Debian
Provide the new password and retype it to confirm. If all went well and the passwords match you should get a ‘password updated successfully’ notification at the end of the console
And that’s how you reset a forgotten root password on Debian 10.
So, first power on or reboot your Debian 10 system. You should be presented with a GRUB menu as shown below. On the first option, proceed and press the ‘e’ key on the keyboard before the system starts booting.
This ushers you to the screen shown below. Scroll down and locate the line that begins with ‘linux’ that precedes the /boot/vmlinuz-* section that also specifies the UUID.
Grub Kernel Parameters
Move the cursor to the end of this line, just after ‘ro quiet’ and append the parameter init=/bin/bash.
For you to reset the password, you need to change the access right from read-only to read-write. Therefore, run the command below to remount the root filesystem with rw attributes.
:/# mount -n -o remount,rw /
Mount Debian Filesystem
Next, reset the root password by executing the good old passwd command as shown.
:/# passwd
Reset Root Password in Debian
Provide the new password and retype it to confirm. If all went well and the passwords match you should get a ‘password updated successfully’ notification at the end of the console
And that’s how you reset a forgotten root password on Debian 10.
How to Reset the Root Password on Debian 9 Stretch
In this article, I will show you how to configure sudo, set root password, disable root login and reset root password. This can be done even if you don’t have sudo enabled and you don’t remember the password. Let’s get started.
Installing and Configuring sudo
Now type in your root password and press <Enter>.
The apt package repository cache should be updated.
It should be installed. In my case it is already installed.
The command should run as root as you can see from the screenshot below.
Setting Root Password
Now type in your desired root password and press <Enter>.
Now retype the root password and press <Enter>.
The root password should be set. Now you can login as root using your root password.
Changing Root Password
Now do the same things as you did on the Setting Root Password section of this article.
Disabling Root Login
Recovering Lost Root Password
If you happen to forget the root password and you don’t have sudo configured, then don’t give up just yet and think about reinstalling the operating system again. There is a way to reset the root password.
First reboot your computer. You should see the GRUB menu when your computer boots as shown in the screenshot below. Select Debian GNU/Linux and press e.
Now remove ‘ro quiet’ part from the end of the line and append ‘init=/bin/bash’ to the end of the line as marked in the screenshot below. Once you’re done, press F10.
remount,rw proc
Now type in your new root password and press <Enter> to continue.
Now re-type your new root password and press <Enter> to continue.
You root password should be changed.
Now press <Ctrl> + <Alt> + <Delete> and your Debian 9 Stretch machine should reboot.
Now you can login as root with your new root password as you can see in the screenshot below.
This is how you reset your root password on Debian 9 Stretch. Thanks for reading this article.
About the author
Most of the time, the root account is disabled, meaning that you cannot access it.
For example, if you did not specify any password for root during the installation process, it might be locked by default.
However, you may want to access the root account sometimes to perform specific tasks.
In this tutorial, you are going to learn how you can change the root password on Debian 10 easily.
To change the root password on Debian 10, you need to have sudo privileges or to have the actual password of the root account.
$ sudo -l User <user> may run the following commands on host-debian: (ALL : ALL) ALL
If this is the case, you should be able to change the root password.
Be careful : changing the root password on Debian 10 will unlock the root account.
Change root password on Debian using passwd
The easiest way to change the root password on Debian 10 is to run the passwd commandwith no arguments.
$ sudo passwd Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
$ sudo passwd root
Recommendation : the root account needs a strong password. It should be at least 10 characters, with special characters, uppercase and lowercase letters.
Also, it should not contain any words that are easily found in a dictionary.
In order to connect as root on Debian 10, use the “su” command without any arguments.
$ su -
Password:
[[email protected] ~]#
Change root password on Debian using su
Alternatively, if you are not sudo you can still change the root password if you have the actual root password.
$ su -
Password:
[email protected]:~#
Now that you are connected as root, simply run the “passwd” command without any arguments.
$ passwd Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
Now that you are logged as root, you can run the “passwd” command in order to change the root password easily.
# passwd Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
Congratulations, you successfully changed the root password on Debian 10!
You can now simply restart your host and start playing with the root account.
In this quick tutorial, you learnt how you can change the root password on Debian 10 : by using the passwd command or by connecting as root and changing your password.
But what do you do if the root password must be modified or reset?
This article shows you how to change the root password for your Linux Mint 20 system via three different methods.
Note: To change the root password, you must have either the current root password, sudo privileges, or have physical access to the system. It is also recommended to save the new password(s) in a secure location to be accessed when needed.
In this article, we will cover how to:
Change or reset root password as root user
Change or reset root password as sudo user
Change or reset root password using GRUB menu
It is worth mentioning that all the commands included in this article have been tested in the Linux Mint 20 system. These commands have been performed in the Terminal, which can be opened using the Ctrl+Alt+T key shortcut, or by clicking on the terminal icon present in the taskbar of the Linux system.
You will be prompted to enter a new root password. Type the new password and hit the Enter key. Then, re-enter the password and press the Enter key to avoid any typos.
After entering the password, you will be shown a message saying that the password has been updated successfully.
Change or Reset Root Password as Sudo User
After entering the password, you will be shown a message saying that the password has been updated successfully.
Change or Reset Root Password Using GRUB Menu
Next, navigate to the Advanced options.
Then, to switch to the edit window, click ‘e’ on the keyboard.
Adding ‘rw’ and ‘init=/bin/bash’ in the above line basically tells the system to log in to bash with read/write privileges. Note that this configuration will only apply for the current boot, not for subsequent boots.
You will be prompted for the root password. Input the root password and press the Enter key. Then, retype the password and press Enter to avoid any typos.
After entering the password, you will then see a message stating that the new password has been updated.
That is all you need to do to change or reset the root password of your Linux Mint 20 system without the sudo or root login. It is good practice to change the password frequently after some time, especially if you think it has been compromised.
Conclusion
In this article, we have identified three different methods to modify or reset the root password on your system. You can opt for any method, based on the privileges you have. If you have the root password or sudo privileges, you can easily reset the root password using the simple ‘passwd’ command. Otherwise, you can use the GRUB menu to change the root password, but only if you have physical access to the system.
I hope this article has helped you in changing or resetting the root password of your system.
About the author
I am a self-motivated information technology professional with a passion for writing. I am a technical writer and love to write for all Linux flavors and Windows.
Check file system permission
mount | grep -w /
The output must be with rw,realtime. It reflects that we have real-time- read-and-write access to the file system.
Finally, we will run the commands that will allow us to change the current forgotten root password of our Debian 12 Bookworm server or desktop system.
passwd
The command will ask you to type the password you want to set twice.
passwd h2s
Modify GRUB to Reset the root password
To open the Grub Menu editing screen, press the ‘e‘ key on your keyboard. This will drop you on an editor, don’t touch or delete anything, just from here move to the next step.
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.
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
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.
Now, let’s change the password as we do normally on a Linux system using the command terminal.
passwd
The system will prompt you to add a new password two times:
passwd username
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.
•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.
How to Reset a Forgotten Debian 11 Root Password
1. Open Debian 11 Grub menu
To reset the password, we must first navigate to the Grub menu on our Debian 11 Bullseye. Restart your system while holding down the Shift key on your keyboard. This will take you to Debian 11’s Grub menu.
2. Edit Gurb Menu to Reset root password
3. Add rw init=/bin/bash
Use your arrow key to navigate to the end of the line beginning with “Linux” on the Grub editing screen. As seen in the screenshot, type rw init=/bin/bash at the end of this line.
rw init=/bin/bash
After adding the given syntax, next, boot your system with this configuration. For that either use Ctrl+X or F10.
How to Reset Root Password in Debian 11 4
4. Debian 11 Root shell Access
For that use a 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 root user password
Now, let’s change the password as we do normally on a Linux system using the command terminal.
passwd
The system will prompt to add a new password two times:
How to Reset Root Password in Debian 11 5
passwd username
passwd debian
How to Reset Root Password in Debian 11 6
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.
You may now log in and access your system using the newly configured root password. This instruction will be beneficial for individuals who have lost or forgotten their root password and wish to change it. The instructions in this article will also work for other Debian 11 versions.
Do you want to learn more about this topic?
Add rw init=/bin/bash to Debian 12’s Grub
You will see a couple of lines that tell the system how to boot itself, so don’t edit anything arbitrarily. Instead, use the arrow keys and move to the end of the line starting with “Linux“. At the end of this line after ro quiet type –
rw init=/bin/bash
To have an idea you can see the given screenshot. Once you are confirmed that the added line is exactly, what we have shown here in the screenshot. After that boot your system with these added changes by pressing F10.
You might like to know what is “rw init=/bin/bash” is that we have added. It is a Linux boot option that tells the system to run the and drop us in a shell (“/bin/bash”) with read and write permissions (“rw” or read-write) to the file system. Whereas, the “init” in the command is the first process that runs when the operating system is booted, and it is responsible for starting and managing other processes.