Resetting the Root Password of RHEL-8

Resetting the Root Password of RHEL-8

Resolution
1) Break the boot sequence by adding ‘rd.break’ at kernel stanza in grub. To do this, restart your system and when the GRUB splash screen comes:

  1. Select/highlight the kernel you wish to boot using the up/down arrow keys.
  2. Press the e key to edit the entry.
  3. Select/highlight the line starting with the word kernel or linux.
  4. Press the e key to edit the line.
  5. Add ‘rd.break’ at the end.
  6. Press ENTER to accept the changes.
  7. Press the ‘ctrl + x’ key to boot the kernel with the modified command line.

2) The system will provide a shell which will be from initramfs:

.
.
Entering emergency mode. Exit the shell to continue.
Type "journalctl" to view system logs.
You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot
after mounting them and attach it to a bug report.
switch_root:/#

3) Root filesystem will be mounted read-only at ‘sysroot’ directory:

switch_root:/# mount | grep -i sysroot
/dev/mapper/rhel-root on /sysroot type xfs (ro,relatime,attr2,inode64,noquota)

4) Remount it with read-write mode:

switch_root:/# mount -o remount,rw /sysroot

5) Chroot into it:

switch_root:/# chroot /sysroot/
sh-4.4#

6) Change the password:

sh-4.4# passwd
Changing password for user root.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.

 
7) Relabel the filesystem:

sh-4.4# touch /.autorelabel

8) Exit from the shell:

sh-4.4# exit
exit
switch_root:/#
switch_root:/# exit

9) The system will continue the paused booting sequence:

.
Starting Relabel all filesystems...
[  OK  ] Started Manage Sound Card St
localhost login:

 

Resetting the root password on a Solaris server

I had to use the following step to reset a the root password on a Solaris system the other day. You will need physical access to the system to use these steps.

  1. Press Stop-A on the console or Ctrl-] and send brk from a remote console connection to access the Open Boot PROM (OBP).
    NOTE : If you are using TeraTerm-Pro, you send a break from the menu.
  2. Insert a bootable Solaris CD/DVD and boot into single-user mode with boot cdrom -s
    If a JumpStart boot server is located on the system’s subnet, and the system was properly configured for JumpStart, you may instead boot over the network into single-user mode with boot net -s
  3. Make a mount point within the /tmp file system by typing mkdir /tmp/mnt
  4. Mount the root partition of your boot disk in /tmp/mnt
    e.g. #> mount /dev/dsk/c0t0d0s0 /tmp/mnt

    NOTE : To check the device name use the format command.

  5. Edit /etc/shadow with TERM=vt100 vi /tmp/mnt/etc/shadow
  6. Remove the encrypted part of the root password (the second field; fields are separated by colons), save, and exit.
  7. Unmount the file system with umount /tmp/mnt
  8. Reboot the system and assign a new password at a shell prompt with the passwd command.

If you are unable to run vi above, you can edit /etc/shadow using the ed editor.
# ed /tmp/mnt/etc/shadow
1p
s/:………….:/::/ (Note: there are 13 dots in the second field)
1p
w
q

Resetting the OMS password

by Richard Parmiter
by Richard Parmiter

We’ve had an Oracle Manage Server (OMS) running here at work for some time now. I think it was setup by a DBA who worked here years ago. The previous DBA didn’t use it so when I came to the job he told me to just login locally to OEM and not worry about using it.
I had some spare time the other day and thought I would have a look into what it could do. One of the first problems I ran into though was that I had to reset my password. Of course I didn’t have the admin password, and the last DBA doesn’t work here any more. So I had to find out how to reset the sysman password.
Continue reading Resetting the OMS password