[The Linux system] CentOS7 (RHEL7) to reset the root password

1. When the system starts, press "e" to enter the editing interface

 

2. Edit Content

 

The rhgb quiet modify  the init = / bin / SH  :

 

Then press  Ctrl + X  .

3. Changing the root password

mount -o remount,rw /
echo new_password | passwd --stdin root
touch /.autorelabel

 

4. Start System

exec /sbin/init

At this point, we can use the new password to log in the system.

 

==

 

Guess you like

Origin www.cnblogs.com/leokale-zz/p/12592235.html