Linux – How to change the forgotten root password

linuxpasswordroot

I forgot my root password…actually I think I know what it is because it is the same password I have for pretty much everything but in the Terminal in tell me "Sorry, try again." Is there a way to reset the password? If so how?

Best Answer

  1. At the GRUB prompt, press the letter, e, to edit.
  2. Scroll to the kernel's boot line.
  3. Add to the end of the kernel boot parameters this value: init=/bin/bash
  4. Press [ENTER] and then b to boot.
  5. Remount the root file system in read-write mode: mount -o remount,rw /
  6. Change the password: passwd
  7. Reboot: reboot
Related Question