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?– Hauke LagingJun 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– Michael MrozekJun 4, 2013 at 2:35
-
@MichaelMrozek Right. I have to read more carefully.– Hauke LagingJun 4, 2013 at 2:40
-
1If 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.– manatworkJun 4, 2013 at 7:43
Add a comment
|
1 Answer
- At the GRUB prompt, press the letter,
e
, to edit. - Scroll to the kernel's boot line.
- Add to the end of the kernel boot parameters this value:
init=/bin/bash
- Press
[ENTER]
and thenb
to boot. - Remount the root file system in read-write mode:
mount -o remount,rw /
- Change the password:
passwd
- Reboot:
reboot
-
1In 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
-
-
Works on Red Hat 8, with the exception of step 4 which is
Ctrl-X
to boot– FredFeb 17, 2022 at 17:11