Centos7 Root password reset
There are issues with selinux contexts if you just reset with any of the old fashion methods.
- Start the system and when BIOS information is displayed, select the option for a boot menu and select to boot from the installation disk.
- Choose Troubleshooting.
- Choose Rescue a Red Hat Enterprise Linux System.
- Choose Continue which is the default option. At this point you will be promoted for a passphrase if an encrypted file system is found.
OKto acknowledge the information displayed until the shell prompt appears.
- Change the file system root as follows:
sh-4.2# chroot /mnt/sysimage
- Enter the passwd command and follow the instructions displayed on the command line to change the root password.
- Remove the autorelable file to prevent a time consuming SELinux relabel of the disk:
sh-4.2# rm -f /.autorelabel
- Enter the exit command to exit the chroot environment.
- Enter the exit command again to resume the initialization and finish the system boot.
I had issues with pam.d using "uid >=1000" as well, and then securetyy. I commented out the >=1000 lines from
system-auth-ac. I added