Retrieve password in CentOS 6.4 and RHEL6.X Single User Mode
In CentOS 6.4 and RHEL6.X single-user mode, you can retrieve the password. When you start the system, the system prompts "enter any key to enter the menu (press any key to enter menu in English)". press enter.
The "CentOS (2.6.32-358. e16.i686)" menu appears.
The following message is displayed: Enter 'e' to edit the commands before booting.
Therefore, we enter the 'E' character, and the following three options will appear on the interface:
Root (hd0, 0)
Kernel/vmlinuz -...
Initrd/initramfs...
Select "kernel..." and press "e:
<BOARDTYPE = pc KEYTABLE = us rd_NO_DM rhgb quiet
Enter "single" at the end of this line (Note: There is a space before single), press enter,
This will return to the interface with the three options (the second item is still selected), and then press 'B '.
Then wait. The operating system is started. No Password is required during this period! The command line is displayed as follows:
Root@www.bkjia.com/] #
Now we can run the command as root.
Change Password:
- (A) For CentOS 6.4, run the "passwd" command to change the password!
- (B) The RHEL 6.x, "passwd" command is invalid!
Run the following command:
Echo 'ybxiang123 '| passwd -- stdin root
The password is changed to 'ybxiang123'
Restart with "init 6!