RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2057365 - Unable to reset root password using rd.break
Summary: Unable to reset root password using rd.break
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: dracut
Version: 9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Pavel Valena
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
: 2056192 2092132 2092150 2092392 2106996 2142820 (view as bug list)
Depends On:
Blocks: 2010412 2092132
TreeView+ depends on / blocked
 
Reported: 2022-02-23 09:57 UTC by Ravindra Patil
Modified: 2023-02-14 16:19 UTC (History)
16 users (show)

Fixed In Version: dracut-057-10.git20220721.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-15 11:22:12 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-113221 0 None None None 2022-02-23 10:02:26 UTC
Red Hat Product Errata RHBA-2022:8379 0 None None None 2022-11-15 11:22:41 UTC

Description Ravindra Patil 2022-02-23 09:57:51 UTC
Description of problem:

I have forgot the root password for RHEL 9 beta installed system. Trying to reset password as per the steps

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9-beta/html/configuring_basic_system_settings/changing-and-resetting-the-root-password-from-the-command-line_configuring-basic-system-settings

However, on editing the kernel entry and adding rd.break, it asks for root password to jump to maintenance mode. 

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Reboot the system and, on the GRUB 2 boot screen, press the e key to interrupt the boot process.

2. Go to the end of the line that starts with linux.

3. Add rd.break to the end of the line that starts with linux.

4. Press Ctrl+x to start the system with the changed parameters.

Actual results:

System prompts for root password. 

Entering Emergency mode. Exit the shell to continue.

Give root password for maintenance
(or press Control-D to continue):

- If we do control-D then system boots normally in graphical.target or multi-user.target

Expected results:
The switch_root prompt appears.
System should get into maintenance mode to be able to reset the root password. 

Additional info:

Comment 1 Jan Stodola 2022-02-23 10:07:53 UTC
Reassigning to dracut for review, this is a post-installation task.

Comment 2 David Tardon 2022-02-23 13:19:33 UTC
dracut uses sulogin to enter the emergency shell since https://github.com/dracutdevs/dracut/commit/32f68c1f9ac3720e8ce4b95a09c0ce680d5da786 , so this hack no longer works. As an alternative, boot from a live CD/USB and mount the root partition from there.

Comment 4 David Silver 2022-03-04 03:50:33 UTC
Ravindra, it seems that the product documentation you referenced for RHEL 9.0 Beta  ( https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9-beta/html/configuring_basic_system_settings/changing-and-resetting-the-root-password-from-the-command-line_configuring-basic-system-settings ) on Chapter 23.3. "Resetting the root password on boot” is based on RHEL 8 and no longer aplicable for RHEL 9 beta.

Entering into a chroot environment in order to reset the root password for RHEL 9 beta can now be done under the rescue boot parameters.

In addition, the current documentation for RHEL 9 beta -Chapter 23.3 - Procedure #4 :  The procedure states that "The switch_root prompt appears". This is also no longer applicable. 

After entering rescue mode and pressing the Enter key for maintenance, the sh-5.1# prompt now appears immediately. After this step, all following steps on current documentation can now be done successfully.


New Steps:

1. Reboot the system and, on the GRUB 2 boot screen, use the down arrow key on your keyboard to select rescue mode. Press the   e   key to interrupt the boot process.

   Red Hat Enterprise Linux (0-rescure-XXXXXXXXXXXXXXXXXXXXXXXXXX) 9.0

2. Go to the end of the line that starts with linux.

3. Add rd.break to the end of the line that starts with linux.

4. Press  Ctrl+x  to start the system with the changed parameters.

5. Press the  Enter  key to enter maintenance mode.

   The sh-5.1# prompt appears.

6. Remount the file system as writable:

   mount -o remount,rw /sysroot

7. Enter the chroot environment:

   chroot /sysroot

8. Reset the root password:

   passwd

9. Enable the SELinux relabeling process on the next system boot:

   touch /.autorelabel

10. Exit the chroot environment:

   exit

11. Exit maintenance mode:

   exit

—-----------------------------------------

I hope this is beneficial.

Comment 6 Nick Barsotti 2022-06-10 06:47:12 UTC
Thank you @David Silver!!!!
The documentation for rhel 9 is still incorrect and needs to be updated.  The documentation at step 23.3 step 1 needs to specify that the rescue kernel option needs to be selected with grub2.
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/configuring_basic_system_settings/changing-and-resetting-the-root-password-from-the-command-line_configuring-basic-system-settings

Comment 9 Šárka Jana 2022-06-15 08:17:49 UTC
*** Bug 2092132 has been marked as a duplicate of this bug. ***

Comment 10 Šárka Jana 2022-06-15 12:26:24 UTC
*** Bug 2092150 has been marked as a duplicate of this bug. ***

Comment 12 Lukáš Nykrýn 2022-06-28 13:38:17 UTC
Let's revert this behaviour to rhel8 one. (no password)

Comment 13 Šárka Jana 2022-06-30 09:36:07 UTC
*** Bug 2056192 has been marked as a duplicate of this bug. ***

Comment 15 Łukasz Filipek 2022-07-10 12:27:26 UTC
I have a quicker way to reset root password in RHEL9. 

0. ctrl + e
1. In linux line change ro to rw and add init=/bin/bash at the end of the line. 
2. ctrl +x
3. passwd
4. touch ./autorelabel
5. exec /sbin/init

Comment 16 Łukasz Filipek 2022-07-10 12:35:48 UTC
(In reply to Łukasz Filipek from comment #15)
> I have a quicker way to reset root password in RHEL9. 
> 
> 0. ctrl + e
> 1. In linux line change ro to rw and add init=/bin/bash at the end of the
> line. 
> 2. ctrl +x
> 3. passwd
> 4. touch ./autorelabel
> 5. exec /sbin/init

4. touch /.autorelabel

Comment 17 Mariya Pershina 2022-07-18 12:04:37 UTC
*** Bug 2106996 has been marked as a duplicate of this bug. ***

Comment 24 Siddharth 2022-11-04 13:41:55 UTC
@Łukasz, 

True that step is working but need to add the following step as well.

0. ctrl + e
1. In linux line change ro to rw and add init=/bin/bash at the end of the line. 
2. ctrl +x
===> mount -o remount,rw / ==> As without it, it is throwing an "authentication token manipulation error"
3. passwd
4. touch ./autorelabel
5. exec /sbin/init

Comment 26 errata-xmlrpc 2022-11-15 11:22:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (dracut bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:8379

Comment 27 David Tardon 2022-11-15 14:43:41 UTC
*** Bug 2142820 has been marked as a duplicate of this bug. ***

Comment 28 Jan Stodola 2023-02-14 16:19:03 UTC
*** Bug 2092392 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.