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
Hello Travis,
My sincere apologies for these.
The issuse was, I had a little book for Linux passwords, and it got misplaced.
I had lost the passwords for Debian too, and I did a Google search and found this.
https://superuser.com/questions/1526520/forgot-user-pass-on-debian-laptop
It worked and now I have got both the root and the user passwords, set to a new password. I have tested and updated Debian and it worked.
Is there a way to access the Red Hat 8.0 disk partition via Debian and fix the password issue in Red Hat 8.0?
Kind Regards,
Denzil
@Denzil -
At this point with all the posts, I'm somewhat confused. If you made it through the password reset process and used the passwd command, the password was changed on disk. You are correct in that you have a multi-boot system and that it defaults to boot Debian, however, that has no bearing on resetting the password. The autorelabel process will take place and yes you might have missed the boot and it boots to Debian on reboot, but that doesn't mean that RHEL 8.x didn't do its thing. You should be able to select the RHEL 8 entry from the boot menu and begin using it.
It is possible to use another Linux distribution (like Debian) that is installed as dual-boot or even a live boot media like Fedora to boot the system and then mount the RHEL8 drive/partition that contains the filesystem for "/" on RHEL, but you must know what that partition is and how to mount it and perform a chroot to make that the new "/" of the filesystem. It gets more complicated if you are using Logical Volumes (LVM) or have multiple partitions for each filesystem because if you mess up, you could impact both Debian and RHEL. If you already went through the password reset procedure for RHEL8, then /etc/shadow should already be updated with the new password on disk.
In terms of setting a default boot, that could also be more complicated as it involves GRUB. You do have a boot partition that contains GRUB and the GRUB entries, but I'm not exactly sure which distribution made your GRUB menu and where you might easily find the GRUB menu config to change it. Generally, you can use the template to modify the GRUB boot menu configuration and regenerate, but doing it incorrectly would make all Linux distributions unbootable until you got it fixed.
WARNING and Caution if you proceed ...
You need to figure out which Linux distribution is in control of GRUB to modify things easily.
/boot/grub/grub.cfg or /boot/grub2/grub.cfg should exist and have the entries for boot. If you used RHEL, the config file to edit would be /etc/default/grub most likely and you would see the entries. You would set the default GRUB entry, and update GRUB. The process is slightly different for Debian vs. Red Hat. Additionally, for RHEL systems, there are 2 commands depending on BIOS or UEFI booting.
BIOS: sudo grub2-mkconfig -o /boot/grub2/grub.cfg
UEFI: sudo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
Note on UEFI the redhat might be a dfferent name/path for the command. You should be able to find this out looking in the directory before running the command.
Hello Travis,
Thank you and appreciate for that again.
Let me reply to your first paragraph.I can confirm each step was execuited successfuly. I got this message. All authondication tokens updated succesfully.
VIZ
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. >> Then I rebooted , managed to get into Red Hat 8.0.
Yet it said Sorry, password authontication did not work.
I will give it a final try, after a while.
Kind Regards,
Denzil
Hello Travis,
With reference to, then /etc/shadow should already be updated with the new password on disk, and having read this message, all authondication tokens updated succesfully.
I wonder why the update did not work?
Kind Regards,
Denzil
Hello Travis,
I just made another attempt and it does not accept the new password.
By the way, using this promt, bash-x.y#, is there a way to make the system auto log into the root?
Somthing it just occurred to me now.
1. The laptop I am using for Linux is having a german keyboard layout
2. However, when I did these installations, I plugged in an USB ketboard, and I did set it to UK, and it is the USB key board I am using.
3. Is there a way to set the key boad from bash-x.y#?
Kind Regards,
Denzil
Hello Travis,
Great news! All of a sudden it worked!
My utmost appreciations for your great, great support!!!
Kind Regards,
Denzil
@Denzil -
I've very glad things worked out for you finally. I have a suspicion it is the keyboard and keyboard layout information as that would definitely "change" your password without actually "changing" your password. Since keyboards have different key mappings and the system would map your keyboard when changing the password it could have been mapped differently than the actual booted system. I didn't know that beforehand.
I haven't done keyboard changes too much as I use a US only keyboard but in testing some for our lab environments ...
localectl list-keymaps - shows keyboard layouts
localectl set-keymaps <layout_name> - set keyboard to specified layout
The setting of the keymap must be done as a privileged user.
You can always use localectl status to see current keyboard and mapping status.
Good day to you Travis,
Thanks a bunch again!
Once I was, finally managed to log into the root, in the GUI it walked me through to set various things, including the keyboard.
My apologies, do I type those commands at, bash-x.y#
Kind Regards,
Denzil
@Denzil -
So yes, if you have a prompt on the command line in this case if it actually reads bash-x.y# that is a command line prompt and the # indicates it is already "root". Those commands are for keyboard mapping and location.
$ localectl status
System Locale: LANG=en_US.UTF-8
VC Keymap: us
X11 Layout: us
X11 Model: pc105
Is from my local Fedora system. The $ means I'm a standard user at the prompt. Again, BASH prompts can be customized. Generally on RHEL systems it would be user@hostname $ or something like that.
Good day to you Travis,
Thank you so much again, and appreciate for that education.
By the way, when I am logged in as "root" what is the easist way to get into " bash-x.y# "
Kind Regards,
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.