Linux

How to Reset/Recover a Forgotten root Password On Linux OS

Main Steps to Reset/Recover root password on LINUX

If you forgot your root password from our dedicated server ,there are two major actions to reset the root password.

The following will describe how to go through reset your root password via rescue mode on dedicated server on both SoftRaid and HardRaid partitions.

Reboot Your server in rescue mode

In order to reboot your server in rescue mode:

  1. Login to your client area
  2. Select your server from the Services list
  3. Click the Power button and select Netboot tab , then Choose Rescue and from Rescue Available select rescue64-pro.
  4. Click Boot Now , then you can now use SSH to connect to your server on rescue mode.

The reboot will generate temporary access codes (password) for the Rescue Mode session. They will be sent to your email.

Change root password in rescue mode

Once you login to your server in rescue mode via SSH you have to run the following commands:

In the command line, enter the command:

    
     parted -l
    
   

If you are using SoftRaid, your root partition will be /dev/mdX

If you are using HardRaid, your root partition will be /dev/sdX

Then Mount this partition by typing:

    
     mount /dev/partitionname /mnt
    
   
Finally run chroot command to allow you run your change password command
    
     chroot /mnt
    
   

Chrooting the command response puts you in the / of the server. Now you can execute commands on your system. Once this is done, enter the following command to recover and change your root account password:

    
     passwd root
    
   

You will then be prompted to change the password (and then type it again to confirm it) of the root account. Once that’s done, you’ll have to change back the “Netboot” option in the Control Panel to “Boot on hard disk” and restart your server to function from hard disk.

XsoftHost Support

Share

Recent Posts

Add Extra IP addresses to server configuration On Ubuntu 17.10 and later

Each failover IP address will need its own line in the configuration file. The configuration…

4 years ago

Create RAID Arrays with mdadm on Ubuntu

What is mdadm? The mdadm utility can be used to create and manage storage arrays…

4 years ago

How to change the maximum upload file size for PHP

There are several scenarios that you might need to increase or decrease your php maximum…

6 years ago

How to install Let’s Encrypt Plugin in WHM/cPanel

What is Let’s Encrypt? Let’s Encrypt is a free certificate authority provided by the Internet…

6 years ago

How to install python in my cPanel and add py extension

Python normally installed on all cPanel hosting server because most of Centos/red hat update system…

6 years ago

How to install and enable GUI GNOME Desktop on centos 7

Usually CentOS 7 comes in a numbers of variants, For most users, there are two…

6 years ago