For Cloud Servers and Virtual Server Clouds with CentOS 7
Forgot the administration password of your server? We'll show you how to reset it using the KVM console.
If you did not define your own password when creating the Cloud Server and did not change the initial password that was assigned automatically, you can display the initial password in the Cloud Panel at any time.
Open the KVM console.
Restart the server and press the e key in the GRUB start menu to edit the start entry.
Remove the parameters rhgb and quiet from the line beginning with linux16.
Add the following parameters at the end of the Linux16 line:
The line should now look something like this:
The parameter rd.break causes the boot process to be interrupted before initramfs passes control to systemd. Thus, the initramfs prompt can be used for command entry.
The parameter enforcing=0 puts SELinux into permissive mode. This saves the later (and possibly very time-consuming) relabelling of the file system, which would be necessary when SELinux is switched off.
Press Ctrl+X to boot the system with the changed parameters. The switch_root prompt of initramfs is displayed.
If the file system is encrypted, the prompt for entering the password may be overlaid by the system messages, making it no longer visible. If this is the case, briefly press the Backspace key. The prompt should be displayed again.
Since the file system is mounted under /sysroot/ with read-only permissions, you must first remount it with write permissions:
switch_root:/# mount -o remount,rw /sysroot
Now switch to a chroot environment:
switch_root:/# chroot /sysroot The prompt changes to sh-4.2#.
Now you can change the password using the command passwd:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
If passwd aborts with the message Authentication token manipulation error, you have to leave the chroot environment again and remount /sysroot - as described in the previous step - with write permissions.
To leave the chroot environment, type the following command: exit
Reboot the server: reboot
The server will now boot back into the normal system. You can then log in with your new password.