centos forget the administrator password how to do

For RHEL7 system

1, restart the virtual host, the boot screen appears, press the edit page e into the kernel

2, in which the parameter linux 16 additionally rearmost row "rd.break" parameter, the program run the modified Ctrl + X

3, about half a minute after the following

mount -o remount, rw / sysroot # file system read-only mode to a read mode, can be modified

chroot / sysroot # change root

passwd

touch /.autorelabel # make selinux take effect, otherwise the system will not boot properly

exit

reboot

 

Guess you like

Origin www.cnblogs.com/LuoYao666/p/11301415.html