How do I change the root password via the Rescue System (Linux) ?

If you have forgotten or lost your root password and want to reset it via the Rescue System, please follow these instructions:

1.) Start your server in Rescue Mode and go to the Dedicated Server Management. There you trigger the function "Start rescue mode". After the rescue system has been started successfully, the root password for the rescue mode is displayed at this point in the central customer management (ZKM). You can find more informations about "How to start the rescue mode" here.

2.) Use this password to establish an SSH connection with the Rescue System (under Windows you can use the client "Putty").

3.) Once you are connected via SSH, enter one of the following commands to find out your root partition (the largest partition is usually the desired root partition):
fdisk -l
or
parted -l

Once you have identified the system partition, mount it:

Without software RAID (/dev/sda1 may vary):
mount /dev/sda1 /mnt

With software RAID (/dev/md0 may vary):
mount /dev/md0 /mnt

4) Now that you have mounted your disk, mount "procfs" and "devfs":

mount -o bind /dev /mnt/dev
mount -t proc /proc /mnt/proc

5.) Use the "chroot" command to enter your system and change the password:
chroot /mnt /bin/bash

6.) Now you should be in your system. Now you can change the password with passwd:

passwd

Note: You will now be asked 2 times to enter the new password, while entering the password Linux typically nothing is displayed

7.) Now that the password has been successfully changed, remove the mounted disks and exit your system with the command:

exit

Return to the root directory with:

cd /

Now remove the included directories one by one again:
umount /mnt/proc
umount /mnt/dev
umount /mnt

8.) Now reset the rescue mode in the central customer management (ZKM) and restart the system with reboot.

9.) You can now use the newly set password to log in via SSH.

You cannot comment on this entry

Rate this FAQ

4.75 (4 Votes)