Language:

Search

How to Reset Root Password On Ubuntu/Debian

  • Share this:

Reset a lost administrative root password   

Restart the system, and after the BIOS screen, hold down the  Shift key. You will then be prompted by a menu that looks something like this:  

 

Capture.PNG


Select Advanced options for Ubuntu  

Now you will see this menu:  

 

Capture1.PNG


Hit the down arrow until you select the 2nd entry from the top (the one with the recovery mode in the description) and then hit Enter .  

Now you will see this menu:  

 

Capture2.PNG


Using the arrow keys scroll down to root and then hit Enter .  

You will now see a root prompt, something like this:  

 

root@ubuntu:~#

 


 

At this stage, you should have a read-only filesystem. You have to remount it with write permissions:  

 

mount -n -o remount,rw /

 


 

Now we can set the user's password with the passwd command.  

 

root@ubuntu:~# passwd root

 

Enter new UNIX password:

 

Retype new UNIX password:

 

passwd: password updated successfully

 

root@ubuntu:~#

 


 

Type in what you want the new password to be at the prompt. After it's successful reboot the machine and the user will be able to log in with their new password.
Sushan Shrestha

Sushan Shrestha

Join me on a captivating journey as I unravel the complexities of maintaining digital infrastructures, troubleshooting labyrinthine networks, and safeguarding the virtual realms from the shadows. Together, we'll explore the challenges and where every click and command shapes the digital destiny.