I have a multi boot installed in my computer; Linux Readhat 8, Derbian Linux and Ubantu.
Appreciate if you colud assist me how to get into the forgotten root password and reset it.
Kind Regards,
Denzil
@Denzil -
It looks like you are following the post and solution from Red Hat (https://access.redhat.com/solutions/1276063) based on your above question.
When you get the BASH prompt, that is a root prompt indicated by #
What you need to type is
mount -o remount,rw /
You don't want to type the entire line, so that isn't quite clear if you typed the entire line or just the part I put above. After you have done that, you can reset the root password in step 10.
This is the "newer" way of doing things. Since you mentioned it was RHEL8, another method you can try is in the PDF that I attached as the older way and you might have success with that. I did it in a VM so I could get nice screenshots of what things look like. Hopefully this information will help get you unstuck.
Hello Travis,
Thank you so much!!
Indeed it worked now and it gave me the option to change the password.
Step 12 execuited and step 13 "The OS will reboot due to relabeling"
Once it rebbots and "you can input the new password for the root user, I shall keep you posted.
Kind Regards,
Denzil
@Denzil -
Glad that worked for you.
Good day to you Travis,
The bootup was taking too long, and it got stuck at line number 2339. Please see attached.(Opps I am unable to attach)
Since it was getting too late, I switched off my laptop and went to bed.
I have given it a stat again.
Kind Regards,
Denzil
@Denzil -
The reboot process can take a long and unspecified amount of time. What you actually did was broke into the nromal Linux boot process to reset the root password. This was done before all the filesystem operations, one of which was loading SELinux and filesystem contexts. Because of that and modifying files on the filesystem, SELinux labels get "lost" or essentially not set properly. The .autorelabel forces the system at boot time to read the SELinux FContext settings from its configuration database and it relabels all files in the filesystem ... so the larger the disk and the more files, the more work it has to do when going though the filesystem. Additionally, disk speed, CPU, and memory can all impact the amount of time it takes to relabel the filesystem and it isn't a one-size-fits-all type scenario as it would be an invidividal instance unique to your current environment.
Ah the Midas Golden touch :
touch /.autorelabel
Good day to you Travis,
Thank you and appreciate your continus professional advise.
Well it finally rebooted, but I tried to connect as root, and it said incorrect password.
Note. If you may see the multi boot scheen shot I had sent you, I left the laptop and once I came back it had rebooted and gone into debian!! My mistake. I did not get this 13. The OS will reboot due to relabeling, you can input the new password for the root user.
However, I have rebooted the laptop thrice and got Linux Redhat 8.0 up and running. Yet it says root password is incorrect.
I hope if I follow the same steps and be patient, it should work?
Kind Regards,
Denzil
If I follow the same steps
Kind Regards,
Denzil
@Denzil -
It is important you boot into the same Linux and that you reset the password for the correct Linux version. Again what is happening is you are "changing" the password.
When you run passwd command it is asking you for the new password. You will need to enter the same password 2x to confirm. When you reboot the system for relabeling, you need to be sure to select the boot entry that you used to boot the system in GRUB and you also need to login with the username root and the same password you chose when you entered it with the passwd command.
One other thing you might be able to do is to create a new user with SUDO capabilitiies and that user can "SUDO" and become the root user that way.
BTW - your other post about setting up a new RHEL or Linux system, by default now Anaconda is disabling the root account and only setting up a user with the ability to SUDO. I still do both on personal systems so that I have accounts and access if I need to get on the system.
Good Day to you Travis,
Thank you so much for your continus support.
Afeter having made a third attempt, and during the relabeling process, owing to the reasons you have explained, I mean the slowness, it suddenly complets the process of relabelng.
This may take 15 to x amouts of time. If I do not have my eyes open, and once the relabeling takes place, it loades Debian GNU/Linux, which is the First in the meanu. Kindly see the attached again.
Is there a way to alter his menu, letting Red Hat Enterprise Linux 8.10 load first or make it wait unil I / user choose what I need to boot into?
Kind Regards,
Denzil
Hello Travis.
An update.
After having assigning a new root passord, I got this message. all authondication tokens updated succesfully
Then..
11. bash-x.y# touch /.autorelabe
12. bash-x.y# exec /sbin/init
13. The OS will reboot due to relabeling, you can input the new password for the root user.
I manged to reach 13, but though I typed the new password, I get an error to say , Sorry the password authtication did not work.
Kind Regards,
Denzil
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.