For operation and maintenance, it is inevitable that you will encounter the situation of forgetting Linux. So how to retrieve or reset the root password of the Linux system after forgetting it? This article takes CentOS as an example:
1. Press any key quickly when turning on the phone, because the default time is 5s
2. The grub menu has only one kernel and nothing to choose from. Press the e key. However, if you upgrade the system or install Xen virtualization, there will be multiple displays.
3. The following is displayed. Select the second item and press the e key
4. The next display is as follows. Add "space" at the end of rhgb quiet, then type "1" or "s" or "S" or "single". Press the Enter key to return to the previous level
5. Press b key to start the system
6. The last interface
7. Enter passwd directly to change the root password
The above is the detailed content of How to change root password in CentOS operating system. For more information, please follow other related articles on the PHP Chinese website!