10

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?

4
  • possible duplicate of How to reset Linux root and grub passwords? Commented 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 Commented Jun 4, 2013 at 2:35
  • @MichaelMrozek Right. I have to read more carefully. Commented 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
    Commented Jun 4, 2013 at 7:43

1 Answer 1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .