Virtual Machine CentOS forget the root password, reset it, Come

The first is not to start the power supply to this step.

 

Step Two: Adding FIG init = / bin / sh When a line fit plus \ write the next row.

 

 The third step: ctrl + x boot

 Step 4: Add the mount directory

 

 Execute the command mount -o remount, rw /

Step Five: Select the need to modify the user's password, choose root here

Run passwd root

Step Six: Enter the new password twice (twice the same password), you have to remember Kazakhstan

If the password is too simple, it will complain, no matter, all right.

Step Six: If you have turned on SElinux, is executed

touch /.autorelabel

And finally: reboot the system execute the command exec / sbin / init

 

Guess you like

Origin www.cnblogs.com/xingrui/p/11470463.html