How to reset forgotten root password in Debian

How to reset forgotten root password in Debian

In this tutorial, we will learn how to reset a forgotten root password in a Debian system. 

So, first power on or reboot Debian system. It 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 .

Scroll down and locate the line that begins with ‘linux’ that precedes the /boot/vmlinuz-* section that also specifies the UUID.

Move the cursor to the end of this line, just after ‘ro net.ifnames=0 biosdevname=0 quiet’ and append the parameter init=/bin/bash.

Next hit ctrl + x to enable it to boot in single-user mode with the root filesystem mounted with read-only (ro) access rights.

To reset the password, we 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 /

Next, reset the root password by executing the good old passwd command as shown.

passwd

With the root password successfully changed, reboot your Debian system by Ctrl + Alt + Del .

And that’s how reset a forgotten root password on Debian.

Thankyou.

    • Related Articles

    • How to reset forgotten root password in ubuntu 16/18

      Firstly, you need to power on or reboot your Ubuntu system. You should get a grub menu as shown below. Next, press the 'e' key to edit the grub parameters. This should display a screen as shown below. Scroll down until you get to the line that begins ...
    • How to reset forgotten root password in centos 7/8

      First, reboot or power on your CentOS 8 system. Select the kernel that you want to boot into. Next, press ‘e’ to interrupt the boot process and make changes. Replace the kernel parameter ro with rw and append an extra kernel ...
    • Change SSH Default Port 22 to Custom Port

      1. Access your linux server using SSH with putty any third party software. 2. Enter your sudo user password or root password. 3. Open SSH configuration file using below command in your favorite editor. [root@ssh-port-change ~]# vi ...
    • How to Install and Configure PowerDNS on centos 7 using MariaDB.

      PowerDNS is a DNS server that works on many derivatives from Linux / Unix. It can be configured with various backends, including zone files of the BIND style, relational databases and failover / load balancing. The DNS recurrent can also be set up as ...
    • Access Linux server using SSH in Windows, Linux and Mac OS.

      Part 1: Access Linux server using SSH in Windows 1. Download PuTTY or another PuTTY download source from URL https://the.earth.li/~sgtatham/putty/latest/w64/putty.exe . The file called “putty.exe” is perfect for simple SSH. 2. Save and download ...