centos7 forget the root system administrator account password solution

First, open centos7, press the "e" in the choice of entering the system interface to enter the edit page.

Press the down arrow to find the line to "Linux16" beginning, at the end of the line input surface

init=/bin/sh

Then press "ctrl + X" single-user mode key combination

 

Then enter

mount -o remount,rw /

(Note that there is space / between and among mount -o rw and with)

Then enter the "passwd" Enter

The next step is to change your root account password, and re-enter a password less than eight (password when you enter is not displayed, it looks like the same did not respond, just enter the correct and enter on it)

Then enter

touch /.autorelabel
exec /sbin/init

The following screen appears after the carriage return, here a little wait a few minutes, the system will automatically restart

Then on the other system restart and then enter check whether they have succeeded modified

Guess you like

Origin www.cnblogs.com/lee-qi/p/11515568.html