How to reset password in single user mode in Ubuntu 18.04

Vineet Kumar
2 min readJan 15, 2021

--

  1. BOOT INTO GRUB MENU:
    The first step is to reboot into the GRUB menu. If Ubuntu 18.04 Bionic Beaver is the only operating system installed you need to keep pressing SHIFT for the GRUB menu to show up.
GRUB MENU

2. Edit Grub Menu:
Using arrows select the Ubuntu menu or the menu you use to boot your system and hit the e key. This will allow you to edit the menu:

Edit Grub Menue with ‘e’

3. Replace keywords:
Using your keyboard replace the following keywords.
FROM:
ro quiet splash $vt_handoff
TO:
rw init=/bin/bash
And if more than one tty console present then remove extra tty console exept One.

Replace ro to rw init=/bin/bash

Once you have made the change press F10 or CTRL + x to perform boot into a single mode.
Reset password
Confirm that your system partition is mounted as read/write (rw):
# mount | grep -w /
If all good, reset your root password with the passwd command:
# passwd
Or if u want to change password for user ubuntu
#passwd ubuntu
Alternatively, you can reset your user password. The following linux command will reset the password for the test user:
# passwd test

4. Reboot

Your root password is now reset. Reboot your system:

# exec /sbin/init

5. Enjoy !!!

The first step is to reboot into the GRUB menu. If Ubuntu 18.04 Bionic Beaver is the only operating system installed you need to keep pressing SHIFT for the GRUB menu to show up

--

--