Reset root password on CentOS cloud server

To reset the root password of your server, you will need to boot into single user mode.

You need to open console first.

To Open the console:
Login to customer area and go to the server details page from Services menu > My Services > Click on service name > Click on Console

CentOS 6

  1. Open Console
  2. Click send CTRL+ALT+DEL to reboot the server. Or press Restart button from the control panel while you have the console open.
  3. You will see a GRUB boot prompt telling you to press any key - you have only a few seconds to press a key to stop the automated booting process. (If you miss this prompt you will need to restart the machine again)
  4. At the GRUB prompt, type A to append to the boot command.
  5. Add the text single and press ENTER
  6. The system will boot and you will see the root prompt. Type passwd to change the root password and then reboot again.

 

CentOS 7

 

  1. Open Console
  2. Click send CTRL+ALT+DEL to reboot the server. Or press Restart button from the control panel while you have the console open.
  3. As soon as the boot process starts, press ESC to bring up the GRUB boot prompt. You may need to turn the system off from the control panel and then back on to reach the GRUB boot prompt.
  4. You will see a GRUB boot prompt - press E to edit the first boot option. (If you do not see the GRUB prompt, you may need to press any key to bring it up before the machine boots)
  5. Find the kernel line (it starts with "linux16"), change ro to rw init=/sysroot/bin/sh.
  6. Press CTRL+X or F10 to boot single user mode.
  7. Access the system with the command: chroot /sysroot.
  8. Run passwd to change the root password.
  9. Reboot the system: reboot -f

 

  • root password, centos
  • 321 Users Found This Useful
Was this answer helpful?

Related Articles

Blocked ports on Cloud Servers

We block ports on Cloud Servers for security reasons. Ports that are blocked by default on...

Can I use my own ISO?

Yes, with the Upload ISO feature, you can upload your own bootable operating system image, mount...

How to set a rDNS/PTR record for my Cloud Server IP?

You can update rDNS record from cloud server portal. From the navigation menu:Services > My...

How many IPv4 can be assigned to a Cloud Server?

Cloud Servers are delivered with 1 IPv4 and you can add one more IP.

Cloud Servers are Managed?

We offer management plan for cloud servers with an additional fee and it's available to cPanel...