cancel
Showing results for 
Search instead for 
Did you mean: 
Denzil
Mission Specialist
Mission Specialist
  • 2,902 Views

How to rest Readhat 8.0 forgotten Root Password.

Jump to solution

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 Peiris
Tags (1)
42 Replies
Travis
Moderator
Moderator
  • 497 Views

@Denzil -

Based on some of the extra information, I suspect it was a keyboard mapping/layout issue between the environment you were in with RHEL when it booted up all the way and the broken-into root shell where you changed the password. Different keyboard layouts would have caused different passwords, so while the password you typed in the interrupted boot process was known to you, you were actually typing a different password in the booted RHEL system because the keyboard got set to a different layout, so different characters were being sent as I have had a similar scenario when I was testing various keyboard layous, I couldn't type a sudo password and authenticate.

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training
0 Kudos
Denzil
Mission Specialist
Mission Specialist
  • 541 Views

Hello Trvis,

 

As regards to your paragraph 2, It is possible to use another Linux distribution (like Debian) that is installed as dual-boot or even a live boot media like Fedora...

Being the new kid in the block for Linux, I shall do a back up first, for all three flavours of Linux. On Sunday the 19th of October 2025, I did a disk check, and was able to list all the partitions, but did not take a screen shot.

Since I was managed to set a new password for Debian Root and user, at leat I have one Linux up and running! However, I am keen to have the Red Hat new password accomplished, though your help.

The one which you have written in RED, there are three  things here 

A. I am not quite certain if the GRUB was done vis Debian and Red Hat! 

B. If I share you the disk partition information, is it possible to reinstall Red Hat 8.0 or 9.0 into the same partition? If yes, reference A, would the Boot Menu get destroyed? 

C. How dangerous is it to play with fire, in relation to your warning?

 

 

 

Kind Regards,

 

Denzil

Denzil Peiris
0 Kudos
Travis
Moderator
Moderator
  • 1,114 Views

@Denzil -

Again, there is always a risk of data loss when repartitioning, installing, and formatting if you select the wrong item. The boot menu can be destroyed in that it get re-written, so that could make all installations non-bootable or it could fix everything. Unfortunately, just a partition layout isn't good enough because you also have LVMs in the mix. Without knowing how the systems were installed, you could have a setup like the following:

/dev/sda (1TB)

/dev/sda1 (450GB) - Debian

/dev/sda2 (450GB) - RHEL

/dev/sda3 (5GB) - Boot

The only known thing would be a common boot partition that the BIOS/UEFI would use. The other partitions could be assigned to a PV/VG/LV which could be laid out in any number of ways. Alternatively, if you did things an "old school way" you could have separate partitions for every mount point following good security protocols, meaning you would have a bunch of partitions on the disk and you could potentially have two (2) partitions for /home one that was Debian, and one that is RHEL.

Unfortunately providing exact guidance in a forum like this is dangerous (especially for this) as you could have any setup under the sun and you could be dealing with differences and customizations that no one is aware of or you might have forgotten. The keyboard layout and different keyboards is a great example of how something that was meant to be a quick fix turns complicated very very quickly.

If you know for certain there is nothing you need on the system and can reload Debian and RHEL, it isn't dangerous at all to play with fire, because the worst thing that happens is it burns down and you rebuild with the newest/freshest installation of both (you are only out time). If you have work or critical personal files on the system without a backup, that is something that would be gone with the fire and couldn't be restored.

One final thing I can offer you ... I had suggested you build a Fedora Live USB. It could be used on this system. You can explore the hard drive by booting into Fedora Live. There you have a wonderful graphical interface. It won't mess up anything on your existing drive. It will however provide you a ton of tools and allow you to mount partitions from both Debian/RHEL and explore the filesystem. That will provide an opportunity to copy critical files off the system. If you choose to leverage Fedora Live, you can even connect to the network and copy the files off to a cloud service like Google Drive, Dropbox, OneDrive, etc. (even pushing things up to Github or something), just so you have a copy of your data.

 

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training
Denzil
Mission Specialist
Mission Specialist
  • 469 Views

Good day to you Travia,

 

My sincere thanks continues.

 

The person who walked me through to install the three flaours of Linix, knew his onions.As regards to your reference to Old School Way, it was the way he taugt and walked me though. At that time, I did things blindy, while I was heavily studying AWS. Now, thanks to you, with all of these Linux technical assistance, I am digesting "Linux" though you and this community! Kindly see attached, if my clain is right. I mean if it has been done according to old School way!

Disk.info.2.jpg

 

 


Disk.Info.1.jpg

 

As regards to, One final thing I can offer you... et el. Indeed I am more than happy to accept this. as per your explanation, I have a good and a strong feeling it would help me a lot. 

As regards to "If you know for certain there is nothing you need on" , well there are no such files. Having said that, two things here.

1. It would be quite a learning stradgey, with your wonderful help,to do a complete reinstallation.

2. Now that my Linux Red Hat 8.0, Debian is up and running.

3. Reference 1, it is highly tempting to reformat and reinstall.

4. Down the line I intend taking an exam or two, too!!

 

Your professional advise please.

 

 

Kind Regards,

 

Denzil

 

Denzil Peiris
0 Kudos
Travis
Moderator
Moderator
  • 461 Views

@Denzil -

So there you have it, I'm guessing Debian was a straight FDisk installation. It looks like you have a /boot on /dev/sda5. It also would appear that your Red Hat (RHEL) installation was done partially the new school method as you do have a partition /dev/sda6 which is a PV/VG and it appears to contain two logical volumes one for "/" and the other for "/home". I would wager that only /dev/sda6 is the partition where you have RHEL8 installed, although can't 100% tell from that. 

Since this is clearly coming from your recovered RHEL8 system, you can use "df -h" from your prompt. This will show you what is mounted and also show the available and used storage. It is a great companion for lsblk. Since this will show what is mounted by default in your RHEL system. You can also check /etc/fstab to see what is in there as it will show all items needed and being mounted by your system.

My guess by looking at this is the entire disk is using the extended partition scheme. Debian is using a massive 105GB partition and fully installed on /dev/sda2. The boot partition is /dev/sda5. RHEL is using /dev/sda6 as a LVM setup with two different LVs on there. I can only guess that /dev/sda/{7,8,10,11} belong to the final Linux flavor and those correspond to "/", "/home", "/usr", "/var" as that would likely be a common way to do things and I have no clue which distro /dev/sda9 is using since it is SWAP. Also if things were labeled and created properly, only RHEL appears to be on a Logical Volume setup, although I did show others from somone else's mistakes that it is possible for Logical Volumes to be created on a partition that is labeled and tagged not as Linux LVM, but as Linux or something else, so just because you don't see it tagged as type LVM doesn't mean an LVM/PV combination doesn't exist.

However, seeing this, one thing you can begin doing is mounting the other partitions as the root user and then taking a look at them with the ls and tree commands.

So you could for example do

# mount /dev/sda1 /mnt

This would mount that partition to the directory of /mnt.

Then you could type 

# tree /mnt

My bet is you would see a complete filesystem for Debian or the other flavor of Linux that has eveything you normally see in "/" which includes a bin, home, opt, var, usr and other top-level directories.

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training
0 Kudos
Denzil
Mission Specialist
Mission Specialist
  • 445 Views

Hello Travis,

My utmost thanks for your explanation in a lay man's language! 

 

I have used two of the commands you have advised me of, and below are the results.

 

 
 
[root@denzil ~]# df -h

 
 
[root@denzil ~]# df -h
Filesystem                    Size  Used Avail Use% Mounted on
devtmpfs                      1.9G     0  1.9G   0% /dev
tmpfs                         2.0G     0  2.0G   0% /dev/shm
tmpfs                         2.0G  9.8M  2.0G   1% /run
tmpfs                         2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/mapper/rhel_denzil-root   60G  8.3G   52G  14% /
/dev/mapper/rhel_denzil-home   30G  532M   30G   2% /home
/dev/sda5                     3.9G  323M  3.4G   9% /boot
tmpfs                         392M   24K  392M   1% /run/user/0

[root@denzil ~]# tree
.
├── anaconda-ks.cfg
├── bash.txt
├── denzil.txt
├── Desktop
├── dnfinstalled.txt
├── Documents
├── Downloads
├── initial-setup-ks.cfg
├── installed.txt
├── Music
├── Pictures
│   └── Screenshot from 2025-10-20 19-55-04.png
├── Public
├── Templates
├── Videos
└── zhs.txt

8 directories, 8 files


For  # mount /dev/sda1 /mnt, I typed the command at, [root@denzil ~]#
 
I am getting the below error
 
[root@denzil ~]# [root@denzil ~]# mount /dev/sda1 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda1, missing codepage or helper program, or other error.
[root@denzil ~]# mount /dev/sda1
mount: /dev/sda1: can't find in /etc/fstab.
[root@denzil ~]#
 
 
However using my two cent brain, I mounted " mount /dev/sda7 /mnt" and then " tree/mnt". It gave a huge output. Then I made a small script and outputted the reults into a file >>> 17192385 Oct 21 10:50 denziloutput. The results may contain few A4 size pages.
 
 
 
 
In the mean time, may you please explain..the below?
#
/dev/mapper/rhel_denzil-root / xfs defaults 0 0

UUID=139d8031-1a6d-4ebd-a2f9-49c2f08ad3d4 /boot ext4 defaults 1 2

/dev/mapper/rhel_denzil-home /home xfs defaults 0 0
~ ~ ~
 
By the way, according to your professional and personal knowlege, what are the best Red Hat 8.0 and DebIan Linx books you could recommend, in relation to "Linux" administration?
 
Last but not the least, this is away from Linux, do you know of a simiar source like this for terraform, not terraform though? 
 
On the other hand, with Terraform do they have a blog like this?
 
 
 
 
Kind Regards,
 
 
Denzil Peiris
0 Kudos
Travis
Moderator
Moderator
  • 435 Views

@Denzil -

First let me address ... [root@denzil ~]# [root@denzil ~]# mount /dev/sda1 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda1, missing

In Linux a lot of times it can "guess" the correct filesystem and mounting blocks. However, generally with the mount command it is best practice to provide a filesystem of the type you are mounting. The partition type was labeled as Linux so I was hoping it was a regular filesystem. It is possible it is not and it is also possible it could be a Windows partition or something like that (although I would have hoped it was labeled otherwise). You can and should however look at all the partitions so you can make an informed decision.

You might get lucky using 

lsblk -f

This would list the block devices with the partitions. It should also have the FSTYPE which would be the filesystem type (how the partition was formatted).

Finally your new question ...

#
/dev/mapper/rhel_denzil-root / xfs defaults 0 0

UUID=139d8031-1a6d-4ebd-a2f9-49c2f08ad3d4 /boot ext4 defaults 1 2

/dev/mapper/rhel_denzil-home /home xfs defaults 0 0
~ ~ ~
 
/etc/fstab is a list of filesystems that get mounted on BOOT. It is generally best practice to use UUID which is a unique identifier based on the filesystem of the device and prevents devices being identified incorrectly in a VM or Cloud scenario (because SDA could come up as SDB) based on device ordering. So the "BOOT" drive/partition is identified by its UUID. For LVM, we have DEVICE MAPPER on Linux. Device mapper creates friendly names for partitions and filesystems (these again are generally unique - however not guaranteed so there could be conflicts - but that would cause issues at the LVM layer with volume tools). Anyways, the LVM entries use the DEV Mapper names which account for your root "/" and home "/home" filesystems. The XFS is the filesystem type, and the DEFAULTS X Y are the additional mount options. 
 
Basically, you have what is needed for the mount command and this gets mounted automatically at boot time.
 
<DEVICE>   <Mount_Point>   Filesystem  Mount_Options
 
For the final question, I would strongly recommend the Red Hat courses especially for learning Linux. The System Administration 1 and 2 would be great for you. Additionally we have a Troubleshooting course that goes into troubleshooting Linux and addressing a lot of what you have asked.
 
One book that used to be good were the Linux Bible but the last one I purchased was in 2012. One of the author's Chris Negus worked at Red Hat and I got my copy signed. Those were always great books and well organized and you could look things up like reference materials.
 
https://www.amazon.com/Linux-Bible-Christopher-Negus/dp/1119578884/ref=sr_1_1?crid=1JIPN194C63QB&dib... (Is one from 2020 and appears to be around RHEL 8, Fedora 30, and Ubuntu 18.04)
 

 

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training
Denzil
Mission Specialist
Mission Specialist
  • 429 Views

Hello Travis,

 

Thank you immensely and your support makes a world of a difference.

Now going back to mount /dev/sda1 /mnt, and your explanation just now,  and  mount /dev/sda6 /mnt it works.

However using  lsblk -f, it does not list which sda holds what. VIZ, Debian or Ubantu.Perhaps I must re-read your explanations again.

 

 

[root@denzil ~]# [root@denzil ~]# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
├─sda1
├─sda2 ext3 storage 3e657278-0b9f-44bc-badb-3c55f744da51
├─sda5 ext4 139d8031-1a6d-4ebd-a2f9-49c2f08ad3d4 /boot
├─sda6 LVM2_member rbEqpO-djGG-B35D-eMb4-Oy73-285e-vvvVhL
│ ├─rhel_denzil-root xfs 698a7d02-2268-4d50-857a-4e4089e3c648 /
│ └─rhel_denzil-home xfs 200e67f3-31f9-4d82-ab8f-0234a96bb080 /home
├─sda7 ext4 a741ba98-0014-4e2c-8050-d810240f4363
├─sda8 ext4 76d7a155-8a68-4452-85d8-de119eeceb36
├─sda9 swap 7647d86e-bbfc-48ee-88d9-e2088cb3f029
├─sda10 ext4 98466f3a-2187-4b0b-a675-c162c6e57b05
└─sda11 ext4 5dc4db85-5035-48dd-8d28-3b4cc52915e6
sr0

My apologies here. what would be the cost for those courses you have recommended?

What is the name of the  Troubleshooting course and the cost?

 

 

Kind Regards,

 

Denzil

Denzil Peiris
0 Kudos
Denzil
Mission Specialist
Mission Specialist
  • 429 Views

Hello Travis,

My apologies to post the below here.

When I am trying to update, I am receiving the below error;

This system is registered with an entitlement server, but is not receiving updates. You can use subscription-manager to assign subscriptions.

How may I solve this?

 

 

Kind Regards,

 

Denzil

 

 

Denzil Peiris
0 Kudos
Travis
Moderator
Moderator
  • 401 Views

@Denzil -

RHEL is a licensed, supported, and entitled product. You must register it to Red Hat which means either a paid account and subscription to give you the RHEL Server entitlement or a free developer subscription that is self-support but allows registration and subscription to updates. 

I'm guessing you would need the second option (https://developer.redhat.com) would be where you register for a developer account. You would then need to do subscription manager register to register your system with that developer account. That should give you active entitlements. It is possible that it was registered a long time ago with a "trial" account but you have no license or active entitlements available. So you might need to do an "unregister" first.

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training
Join the discussion
You must log in to join this conversation.