Centos7 is an open-source Linux kernel-based free system. For more information, see the steps for resetting the password of centos7. Rhel7/centos7 uses grub2 to replace the previous grub boot, which is changed from init initialization to systemd initialization. The root password is different from the previous one. Details: 1. start the system and run centos 7 on the GRUB2 boot screen. centos 7 is an open-source Linux kernel-based free system. The following describes how to reset the password in centos 7, I hope this article will help you.
Rhel7/centos7 uses grub2 to replace the previous grub boot, which is changed from init initialization to systemd initialization. The root password is different from the previous one. The details are as follows: 1. start the system and press e to enter the editing mode when GRUB2 starts the screen display.
2. add the following content at the end of the parameter line of the kernel bootstrap line
- Init =/bin/sh
3. press Ctrl + x to start to shell and boot to single-user mode.
4. mount the root partition in read/write mode
Mount-o remount, rw/You can change the password through passwd, but pay attention to two points here:
A. If selinux is enabled on the host, you must create the autorelabel file in the root partition. Otherwise, the system cannot be started normally. the operation command is as follows:
Touch/. autorelabel B. after the modification is complete, the reboot command executed as in the previous version is invalid. you need to enter the full path command, as shown below:
Exec/sbin/init or exec/sbin/reboot