- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 35.8K Views
Can someone please describe which is the correct way to reset forgotten root password in RHEL9? As someone mentioned in some other post, rd.break method doesnt work in RHEL9.
Tnx
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 28.4K Views
rd.break does not work in RHEL 9.0. It works in 9.1, 9.2, etc.
For RHEL 9.0:
1: reboot the system. When the grub bootloader screen appears, use the UpArrow and DownArrow keys to stop the countdown timer. Be very quick, as the timer can be set anything from 1 to 5 seconds.
2: On the linux line: Remove all console= and vconsole= key=value pairs, if they exist (common in VM installations). Add init=/bin/bash to the end of the line. Press Ctrl x to continue.
3: At the bash-5.1# prompt, enter the mount -oremount,rw / command to remount the system’s root as read/write.
4: Enter the passwd root command to change root’s password
5: Enter the touch /.autorelabel command. Do not typo this command or you get to start over (we call that practice).
6: Enter the /usr/sbin/reboot -f command to reboot the system.
---
The system will now reboot and relabel (because of the existence of the /.autorelabel file from step 6) all the directories and files in the filesystem. It can take a long time (especially if there are lot of objects on the system).
The system will delete /.autorelabel file and reboot again, normally.
At this point, you should be able to log in as root using the password you’ve set.
Estrella Mountain Community College
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 28.4K Views
rd.break does not work in RHEL 9.0. It works in 9.1, 9.2, etc.
For RHEL 9.0:
1: reboot the system. When the grub bootloader screen appears, use the UpArrow and DownArrow keys to stop the countdown timer. Be very quick, as the timer can be set anything from 1 to 5 seconds.
2: On the linux line: Remove all console= and vconsole= key=value pairs, if they exist (common in VM installations). Add init=/bin/bash to the end of the line. Press Ctrl x to continue.
3: At the bash-5.1# prompt, enter the mount -oremount,rw / command to remount the system’s root as read/write.
4: Enter the passwd root command to change root’s password
5: Enter the touch /.autorelabel command. Do not typo this command or you get to start over (we call that practice).
6: Enter the /usr/sbin/reboot -f command to reboot the system.
---
The system will now reboot and relabel (because of the existence of the /.autorelabel file from step 6) all the directories and files in the filesystem. It can take a long time (especially if there are lot of objects on the system).
The system will delete /.autorelabel file and reboot again, normally.
At this point, you should be able to log in as root using the password you’ve set.
Estrella Mountain Community College
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 28.4K Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 28.3K Views
I can assure it it does work as I've just done it again.
Did you make certain to do Step 2?
2: On the linux line: Remove all console= and vconsole= key=value pairs, if they exist (common in VM installations). Add init=/bin/bash to the end of the line. Press Ctrl x to continue.
What's your grub look like? Perhaps take a screenshot and post it?
Estrella Mountain Community College
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 28.2K Views
I tried it in RH134 course lab and both methods work (rd.break and init=/bin/bash).
It seems that issue is only in my home lab.
Thank you again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 24.9K Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 28K Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 28K Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 28K Views
rd.break is what I have practiced 100+ times...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 27.9K Views
Hi @Tracy_Baker , I reserveed my RHCSA exam but didn't find newer versions than v9.0 for the exam, so the rd.break method won't work in the exam environment?
Thanks in advance