How To Reset CentOS 7 Root Password
Just like with other distributions, you can use the NoVNC console to reset CentOS 7 root password. By adding a simple line of code to the boot configuration you can update the password and get access back to your instance. To get started log in to your client account. Access the Discovery control panel for the instance you want to change the password on.
Access NoVNC Console
So, from the control panel click the NoVNC icon to bring up the console. Select the gear icon to the left and reboot the instance. When you see the list of Kernels, press the up arrow key to stop the NVMe VPS from automatic boot.
Next, select the kernel you usually use and press the “e” key.
Find the line starting linux16 and the section starting “ro”
So next, change “ro” to “rw” and add “init=/sysroot/bin/sh“. So the line looks like this
In single-user mode enter the below commands to update the root password. But, on reboot, the instance password will be updated.
chroot /sysroot passwd root touch /.autorelabel exit reboot
Instead of using passwords why not use an SSH key? By using an SSH key you can log in to your instances without having to type a password and, adding an SSH key is easy. Go passwordless. Learn how to Create SSH Keys and install them in the Discovery control panel.
How was this article?
You might also like
More from Instance Management
How To Connect An Internal Instance To A Production Instance On the Discovery network, NVMe VPS Servers can be connected to …