reset root password
Log in to a system and change the root password when the current root password has been lost.
Break into the rhel9 OS and change root user's password,
after changing root password, change hostname permanently
Solution 1:
Press ESC to launch GRUB2 menu, press E to edit the loader, find linux kernel loading line, add following string at the end of line:
rd.break console=tty1 rwThen press CTRL+X to save and load the OS. After OS loads, type this commands:
chroot /sysroot
passwd root
touch /.autorelabel
/usr/sbin/reboot -fSolution 2:
Press ESC to launch GRUB2 menu, press E to edit the loader, find linux kernel loading line, add following string at the end of line:
rd.breakThen press CTRL+X to save and load the OS. After OS loads, type this commands:
mount -o remount,rw /sysroot
chroot /sysroot
passwd
touch /.autorelabel
/usr/sbin/reboot -fSolution 3:
Press ESC to launch GRUB2 menu, press E to edit the loader, find linux kernel loading line, add following string at the end of line:
rw init=/bin/bashThen press CTRL+X to save and load the OS. After OS loads, type this commands:
passwd root
touch /.autorelabel
/usr/sbin/reboot -fChanging hostname:
hostnamectl status
hostnamectl set-hostname new-nameLast updated
Was this helpful?