MaiDeveloper

How to reset linux root password with SystemRescueCD?

Sometimes we forget root password and needs to reset. One of the approach is to reset via SystemRescueCD.

Switch to root.

su - root

Find out the root logical volume.

lvdisplay

lvdisplay

In this case, /dev/vg/root is our root logical volume.

Mount the root logical volume

First create an directory to mount to.

mkdir /mnt/root

Mount the logical volume.

mount /dev/vg/root /mnt/root

Change the root directory from SystemRescueCD to the one that just mounted

chroot /mnt/root /bin/bash

Reset root password

passwd root

You will be prompted to enter an new password.

Reboot

exit
reboot


Mike Mai
Mike Mai   Brooklyn, New York
I am a full-stack web developer. I love to learn cutting-edge technology and solve problems. I also like photography and graphic designs.