Recovering the Root Password (Ubuntu)

This guide will provide you with an information on how to reset lost root ( administrator ) password on Ubuntu 16.04Start or reboot a system to get into the boot menu.

In the first step you need to reboot your Ubuntu 16.04 Server to Grub’s menu.

Once you reboot to Grub menu, select the first menu item or the menu item you normally use to boot your Ubuntu system and press e to edit:

Once in the Grub’s boot menu edit mode use navigation arrows to locate a line starting with linux and edit it to include read-write mode rw and init=/bin/bash.

Press Ctrl + X to boot.

If all went well you should now see root shell command line and your root partition should be mounted with read/write flags. To confirm run:

# mount | grep -w /

Now we are ready to reset root’s password. To do so, simply run passwd command with no arguments. When prompted enter your new root password:

# passwd root

Reboot your system using the following command:

# exec /sbin/init

Now, you can Login / Access your Server using the new Root password.

Mohammed has written 27 articles

One thought on “Recovering the Root Password (Ubuntu)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>