This topic is not applicable to OpenVZ under the SolusVM Management Panel, nor to XEN, because of these two architectures, you forgot to directly reset the root password in the background. However, what if you forget to install an independent server or KVM step by step? This article records solutions to similar problems.
I used to ask Zhao Rong, a friend of KVM, to forget the root password. Where can I change it? I usually think that reinstalling the system ...... Please forgive me for my ignorance. reinstalling is undoubtedly not the best choice. We can easily reset the root password through VNC connection.
Next I will take a VPS for testing. This article uses CentOS5. * as an example to test two KVM architecture VPS: XSVPS. COM (Kansas) and VPSPLAZA. COM (Singapore)
Assume that we forget the root password. First, log on to the SolusVM Management Panel, and restart the system first, and then connect to the VNC.
You can directly click the VNC button in the panel, or you can record the VNC information and use the tool. Here, I will execute it directly in the background.
Pay attention to the above step, restart and immediately go to VNC, the action is a little faster, because the Start menu is skipped soon, as shown in the countdown, press the keyboard up and down arrow keys to select.
Is the currently available system kernel. After selecting and changing the line, press "E" on the disk to edit it.
For example, select the second row and press "E" to edit it.
Add "Space single" at the end of the line to change. Note that a space is left between single and the previous part.
For example, I framed it in red.
After the input is complete, press enter to save, and then press "B" to start in this single-user mode.
At this time, the system logs in directly without entering any password, such:
It's easy here. We can set the root password at will, directly run passwd or passwd root, enter the password that needs to be set twice in a row, and restart the machine, you can log on with the modified password.
The above method is applicable to the KVM architecture VPS and those independent servers with IPMI management.