If you are using the Ubuntu Linux for testing purpose and forget the administrative or root password then you don’t need to format your system. You can change the root password without any recovery CD/DVD by using the Ubuntu Grub and few commands. This Ubuntu password reset tutorial will guide you through step by step procedure to get the root access. This tutorial can work for almost all current active Ubuntu versions such as Ubuntu 12.04 | Ubuntu 14.04 |Ubuntu 15.04 | Ubuntu 16.04 | Ubuntu 17.04.
ALSO SEE: How to Setup Ubuntu Root User Password Using Command
How do I reset a lost administrative or root password of Ubuntu Linux?
Reboot Ubuntu Linux System to Grub Menu
Step 1: First of all reboot your Ubuntu Linux box and when bios appear, hold the shift button until you see the Ubuntu Grub Menu as shown in the screenshot.
Step 2: Once you see the Grup menu use the arrow key to select the Ubuntu default menu as shown in the above screenshot and press the “E” key to edit.
Step 3: The Grub edit menu will look like something shown in the screenshot and its time to alter some lines.
You need to find the following line:
ro quiet splash $vt_handoff
Replace the above line with this one:
rw init=/bin/bash
Once the editing has done press the ctrl+X to exit. We are replacing it to get a read and write access.
Step 4: After executing the third step of this tutorial you see the Ubuntu rebooted in shell command and now we need need to mount the root partition with read/write flags. For that run the following commands:
[email protected](none):/# mount | grep -w /
Step 5: After running the above command successfully simply run the passwd command to change the Ubuntu root password.
[email protected](none):/# passwd
Reboot System
After changing the password reboot the system to using this command to ignore any error.
[email protected](none):/# exec /sbin/init
If you got any error like
passwd: Authentication token manipulation error passwd: password unchanged
This means your mounted root partition is read-only and make it write using the following command:
# mount -o remount,rw /
After changing the root password you can also change the other user’s password via terminal or Grub menu.
If you stuck somewhere or have any confusion please let us know…
Related Posts
15 Best Linux Based OS for Raspberry Pi
Rufus for linux? Not available, Use these best alternatives
How to install Anaconda on WSL Windows 10/11 using Ubuntu Linux App
10 Top Most Beautiful Linux Distros or Operating systems
How to install Adminer on Windows 10 or 11?
How to install Nextcloud server on Windows 10