How to Reset Lost or Forgot Root Password on Ubuntu Linux 18.04 LTS

Forgot or Lost root password ? No worry, In this post we are going to see some easy steps to recover lost or forgot root password in Ubuntu 18.04 LTS Server.
Requirements:

 

1. Running Ubuntu 18.04 LTS Server.

 

2. Physical accees of the system.

 

 

Steps:

1. Boot System into GRUB menu

Reboot the system into GRUB menu, keep pressing SHIFT key to show up GRUB menu as shown below (Click on picture to enlarge it).

2. Edit GRUB Menu

Select Ubuntu menu using arrow keys (Up and Down) and hit the e key to edit the menu. Search below lines (Highlighted with RED square below screenshot)
ro quiet splash $vt_handoff 
or
ro maybe-ubiquity
(Click on picture to enlarge it)
and replace with below line (Highlighted with RED square below screenshot).

 

rw init=/bin/bash
(Click on picture to enlarge it)

3. Boot the System into Single Mode

Once you have done the changes, press F10 or CRTL+x to boot into single user mode.
(Click on picture to enlarge it)

4. Reset root password

Make sure that your system partition is mounted as R/W mode. Below command to confirm that our system partition is in R/W mode  (Click on picture to enlarge it).
# mount |grep -w /
If all ok, reset root password with passwd command below.
# passwd
You can also reset user password with following command.
# passwd teclues

5. Reboot the System

Password is reset, now reboot the system with following command.
# exec /sbin/init
That’s it, we have seen easy steps to reset forgot root password in Ubuntu Linux 18.04 LTS. Please share it with others also follow us on tecluesdotcom Facebook Official Page.

 

Leave a Comment