Reset Linux Root Password Using Rescue CD

      No Comments on Reset Linux Root Password Using Rescue CD

In this guide we’ll cover how to reset a forgotten Linux Password.

This guide applies to the following Linux distributions

  • Ubuntu
  • Centos – (With Selinux disabled or Permissive)
  • Debian

Download the linux system-rescue-cd ISo from this here. Attach the ISO to you Virtual instance and configure the VM to boot into the ISO

Choose Option 1

Press Enter to use the defaults

After the system has booted up, you should see a console similar to this

Type the following command to confirm that the disks are listed

Type the following command to view the file systems on the partitions

As shown above, the second column shows us the filesystem on the disk. In our case, the disks were configured with LVm. Therefore, we’ll take an extra step to identify the logical volume that has the root disk.

Run this command to list all logical volumes on the system

Identify a logical volume whose LV path ends with root. in our case, the path is

This is the logical volume we’ll mount as our root disk.

Mount the logical volume to /mnt using the following command

Run chroot against the mounted disk and start bash shell

You should see a console similar to the one shown below

Reset the password using the passwd command as below

Password reset is done. Reboot the VM and try logging in with the new password again

 

The following two tabs change content below.

harun

Harun is a System Administrator with proficient knowledge in cloud technologies such as KVM, Cloudstack, Citrix Xen Server, Openstack and VMware Vsphere Suite, Ceph, NFS, ISCSI

Latest posts by harun (see all)

About harun

Harun is a System Administrator with proficient knowledge in cloud technologies such as KVM, Cloudstack, Citrix Xen Server, Openstack and VMware Vsphere Suite, Ceph, NFS, ISCSI

Leave a Reply

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