How to Reset Lost Root account password?
- Restart
- In grub menu select advanced options
- Press “e”
- Scroll down to the last line in “linux /boot/vmlinuz” sentence
- replace the “ro” with “rw”
- And add “init=/bin/bash” at last
- Press “F10” to reboot
- In console type these commands
mount -n -o remount,rw /
Now reset passwordpasswd root
orpasswd username
to reboot the computer typeexec /sbin/init
METHOD 2: Reset Lost Root Password Using Live CD
- Boot from any linux Live CD.
- Type these commands
to become root
sudo su
find the location of the hard disk partitionfdisk -l
in most cases it will be /dev/sda1 mount it in different foldermkdir /mnt/recover
mount /dev/sda1 /mnt/recover
chroot into itchroot /mnt/recover
reset the passwordpasswd root
orpasswd username
exit unmount the root partitionumount /mnt/recover
exit and reboot
Info
Changing the root password in Linux is easy, though it requires you to venture into the dark realm of the command line. Do note that anyone who has access to your computer can use this method to reset your superuser or root password. One precaution you can take is to encrypt the whole hard disk so it can’t be booted or mounted so easily.