Centos forgot password, how to reset password

(1) Restart Centos. During the startup process, long press the "ESC" key to enter the GNU GRUB interface.

(2) Select the system you want to enter and press the "E" key (edit the command before starting).

(3) Select the kernel "kernel" of the second operating system and press the "E" key (edit the selected command in the boot order).

(4) In the interval after "rhgb quiet", enter "1" or "single", and press Enter to save. (Pass the boot parameters to the kernel to enter single-user mode)

At this point, it returns to the GRUB interface.

(5) At this time, press the "B" key to start the system.

(6) Enter the command line "passwd root" to re-modify the root password, and press the "Enter" key.

(7) Enter a new password, press enter to save, and then re-enter the confirmation password.

(8) If the prompt of "all authentication tokens updated successfully" appears, it means that the password has been changed successfully.

(9) Enter the "shutdown -r now" command line, restart the system, and log in with the root account.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325120639&siteId=291194637