As a beginner of Linux, we may sometimes forget the root password to make their own haste, some people may have to choose to re-install the system, learning this operation will be able to easily solve the forgotten password problem
Select Restart virtual machine on a virtual machine that is already open
Press the up and down arrows in this interface,
Then enter the Grub page by the letter "E"
Look for the "Linux16" line, change the character "Ro" to "RW", and then "RHGB quiet" deleted, in the "Lang=en_us. UTF-8 "After writing" Init=/bin/bash "
Then follow the prompts "Ctrl+x" to start, enter the following interface
At this point, use the command chroot/sysroot/to switch to the normal system,
If you are using a system with Chinese, it will appear garbled, as long as the input: lang=en can be resolved
Finally, you can modify the new password: passwd root
Modify Complete
The final step, be sure to note yo, after the completion of the modification to enter: Touch/.autorelabel
This is done, to the virtual machine interface restart can, after restarting may wait a while, rest assured, will be successful!!
欢迎大家来踩:http://blog.51cto.com/13762582
Beginners Learn Linux: Single-user mode under CentOS7