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 rootorpasswd usernameto 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 sufind the location of the hard disk partitionfdisk -lin most cases it will be /dev/sda1 mount it in different foldermkdir /mnt/recovermount /dev/sda1 /mnt/recoverchroot into itchroot /mnt/recoverreset the passwordpasswd rootorpasswd usernameexit unmount the root partitionumount /mnt/recoverexit 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.