||Home||Switchboard||Unix Administration||Red Hat||TCP/IP Networks||Neoliberalism||Toxic Managers|
|(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and bastardization of classic Unix|
|Recommended Links||Grub||Boot Directly into a Shell||Runlevels||mount command||Serial console|
|Troubleshooting Errors in /etc/fstab||Mounting partitions with chroot||Linux root password recovery||/etc/inittab||/etc/fstab/||Filesystem mount options||Reverting permissions in etc to redhat defaults||Mounting Linux filesystems|
|Resetting root password on MySQL||Minimalistic and Rescue Linux Distributions||Humor||Etc|
If you boot a RHEL 7 system into the rescue or emergency target, you are prompted for the root password. But what if you have forgotten the password? This exercise shows the steps required to reset a lost password for the root user. During the password-recovery process, you probably won’t have access to documentation. Hence, you should practice the following procedure until you can use it in a crisis:
mount -o remount,rw /sysroot
Now, execute chroot command. After that you can reset the password:chroot /sysroot passwd
10. Change the root password:
11. Because SELinux is not running, the passwd command does not preserve the context of the /etc/passwd file. To ensure that the /etc/passwd file is labeled with the correct SELinux context, instruct Linux to relabel all files at the next boot with the following command:
12. Type exit to close the chroot jail, and then type exit again to reboot the system.
13. It may take a few minutes for SELinux to relabel all files. Once you get a login prompt, confirm that you are able to log in as the root user.