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?

  • possible duplicate of How to reset Linux root and grub passwords? Jun 4, 2013 at 2:21
  • @HaukeLaging That one is harder and specifically says they can't edit the grub boot line, which is the answer posted here Jun 4, 2013 at 2:35
  • @MichaelMrozek Right. I have to read more carefully. Jun 4, 2013 at 2:40
  • 1
    If you are sure you know what the password is, then maybe it got truncated. On an old Linux once I set a 10 character password, which was somehow truncated to the first 8 characters. Just a hint.
    – manatwork
    Jun 4, 2013 at 7:43

1 Answer 1

  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
  • 1
    In my case I just added "single" to the end of kernel line and password change worked without the remount part. Oct 27, 2013 at 14:59
  • on Debian Squeeze Oct 29, 2013 at 23:55
  • Works on Red Hat 8, with the exception of step 4 which is Ctrl-X to boot
    – Fred
    Feb 17 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.