Jeffimgcls Hi, I'm Jeff! Resume Linkedin Mail

Resetting the Root Password with Grub 2 Password Protection Enabled (Bypass Grub 2 Password Protection).

If your server has a grub2 password enabled, then you can boot the machine using a live CD (Ubuntu in this case) and bypass it to reset the root password.Make note of the hard drive and partition that the root directory is installed on by running:

fdisk -l

Download a copy of Ubuntu and either create a live CD, USB, or just use the ISO for virtual machines. For physical servers, boot from the live CD or USB to run Ubuntu and access a terminal. For virtual machines, mount the Ubuntu ISO to the VM's CD/DVD drive, make sure it is connected and available. Go to the VM's options and tell it to boot into BIOS on the next reboot. Reboot the VM and set the boot order so that the server will boot up from the ISO and start up Ubuntu.

Once you are running Ubuntu and have access to a terminal, list the drives and partitions of the server to verify you still see the drive and partition you need.

sudo fdisk -l

Create a directory where you will mount the existing file system:

sudo mdkdir /media/recovery

Mount the file system:

sudo mount /dev/sdb1 /media/recovery

Change the working root directory to the file system you just mounted

sudo chroot /media/recovery

Change the root users password

sudo passwd root

remove the live CD/DVD/USB media and reboot.

When your server starts back up, the root password should be changed.

©, All rights reserved.