Articles on: ggRock

🔧 Resetting the Root Password on Debian

If you've forgotten the root password on your Debian system, you can reset it by following these steps:


1. Reboot the System


If your system is running, restart it.


2. Access the GRUB Menu


As the system begins to boot, you should see the GRUB menu.

If it doesn’t appear automatically, hold the Shift key during startup until it does.


3. Edit Boot Parameters


  • Use the arrow keys to highlight the default boot option (usually the first one).
  • Press e to edit the boot entry.


4. Modify the Linux Line


  • Locate the line starting with linux.
  • Navigate to the end of this line, add a space, and append the following:


  init=/bin/bash


5. Boot into Recovery Mode


Press Ctrl + X (or F10 on some systems) to boot using the modified parameters.

This will launch a minimal shell environment.


6. Remount the Root Filesystem


Once at the shell prompt, make the root filesystem writable:


mount -o remount,rw /


7. Change the Root Password


Now reset the root password:


passwd


Enter your new password when prompted and confirm it.


8. Reboot the System


After updating the password, reboot:


reboot


Your system will restart normally, and you should now be able to log in as root with your new password.


Updated on: 23/03/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!