Getting into single-user mode if you want to reset the root password on Ubuntu server 18.04…
Please follow the below steps.
I am doing this in an oracle virtual machine, The steps will be almost similar in physical or virtual machines. ( Maybe there are some changes depending on the bios or the grub version you are currently on)
![](https://vaves.in/wp-content/uploads/2019/12/image-1.png)
After POST (Bios Animation, In this case, oracle virtual box screen) Press Esc as quickly as possible. Some times the screen goes so quick that we have to reboot again and try a few times to get the above screen (Screen-1). You will be seeing something similar to this, press “e” to edit the grub line you will see something like below image starting with “setparams.” See (Screen-2)
![](https://vaves.in/wp-content/uploads/2019/12/image-2.png)
Use your arrow key to reach till the line “ Linux boot/vmlinuz…… “ at the end of the line, you will see something like below code.
“ro quiet splash $vt_handof”
Refer screen-3
![](https://vaves.in/wp-content/uploads/2019/12/image-3.png)
remove it and add
“rw init=/bin/sh”
![](https://vaves.in/wp-content/uploads/2019/12/image-4.png)
then press ctrl +x to boot, this will drop you in it the shell.
![](https://vaves.in/wp-content/uploads/2019/12/image-5.png)
Some times you have to remount / as “rw ” to make the changes take effect. For that
mount -n -o remount rw /
You can change the password from here with the normal password command. After successfully changing the password reboot/reset the pc/server/virtual machine.
For any other tasks please use the ubuntu advance rescue environment to perform a suitable task. Please note that you should know the root password in these advance modes to proceed with the task.
For booting into the advance rescue environment you should follow the step until you get Screen-1, choose the advance option for ubuntu.
![](https://vaves.in/wp-content/uploads/2019/12/image-6.png)
After pressing you will be greeted with 2 options “Ubuntu , with Linux x.x.x-generic and Ubuntu, with linux x.x.x-x (recovery mode)
![](https://vaves.in/wp-content/uploads/2019/12/image-7.png)
Choose the recovery mode, You will be able to see a quick menu for various tasks. Refer Screen-8
![](https://vaves.in/wp-content/uploads/2019/12/image-8.png)
Now you can choose the respective task from here and perform it.