How to reset a root password on VPS and a Dedicated server with CentOS 7

Security  Centos VPS Payment DedicatedVirtual server Dedicated server Administration  Soft

  • Reset a root password on VPS
  • Reset a root password on a Dedicated server

Reset a root password on VPS

If a server is enabled and downloaded, you should reboot it using the button Send Ctrl+Alt+Del.

how to reset a root password on vps and a dedicated server with centos 7

After BIOS reboot, you will see the developer menu GRUB.

how to reset a root password on vps and a dedicated server with centos 7

To change the lines of the download menu, you should use the button and . Highlight the necessary line and press the button е. This will start the editing of download settings.

Then, you should find and edit the line of initial download, which starts from linux /boot/…

how to reset a root password on vps and a dedicated server with centos 7

The ro (read-only) feature downloads Linux core in the reading mode. To save the changes after you reset the root password, you should change ro to rw (read-write) in the reading-recording mode.

Let’s state the launch of the bash command by entering rw init=/sysroot/bin/sh as we see in the screenshot.

how to reset a root password on vps and a dedicated server with centos 7

Then, you should press Ctrl+X or F10 and wait for the download of the operating system in a single-user mode.

To install a new root password, enter the command:

chroot /sysroot 

Then the command:

passwd root 

Then, enter a new root password:

how to reset a root password on vps and a dedicated server with centos 7

Let’s save the changes using the commands:

exit 

reboot 


Reset a root password on a Dedicated server

In the IPMI web interface, access the section Remote Control → Console Redirection and press Launch Console.

how to reset a root password on vps and a dedicated server with centos 7

Remember that to work in the console, you should have Java Runtime Environment software installed. The installation file will be downloaded automatically after you press Launch Console.

Save and launch the file. Then, tick the dialog box at the bottom and press Run.

how to reset a root password on vps and a dedicated server with centos 7

If you launch it for the first time, you may see the message from the Java security system:

how to reset a root password on vps and a dedicated server with centos 7

If you see the screen, you should enter the IP address IPMI (using both http:// and https:// protocols) in security exceptions in the Java settings. You can see the guide for this on the Java website. Then, you can start the console.

After you log in to the console, you should reset the server. To do this, go to the section Remote Control → Power Control and choose Reset server.

how to reset a root password on vps and a dedicated server with centos 7

After you reset the server, before you launce your OS, you will see the GRUB menu in the BIOS menu.

how to reset a root password on vps and a dedicated server with centos 7

Use the buttons and for menu navigation. Then, choose your download line and press e for editing.

Find a line starting from linux in the 64-bit version of IBM Power Series and linux16 in systems based on BIOS x86-64 or linuxefi in UEFI systems.

Change the parameters from ro to rw, delete the parameters rhgb and quiet:

how to reset a root password on vps and a dedicated server with centos 7

Then, add rd.break enforcing=0 at the end:

how to reset a root password on vps and a dedicated server with centos 7

Press CTRL + X to launch the system in the single-user mode.

Start the commands to change the root password and reset the system:

chroot /sysroot 

passwd root 

touch /.autorelabel 

exit 

reboot 


If you have any difficulties in the setting or you have extra questions, contact our customer support using the ticket system.



Blog