The mounted partitions are available in the directory /mnt
. This means, you find the partition /dev/sda1
mounted in /mnt/sda1
.
How to change the root password
This document shows you how to change your password using the rescue system. If you try to use the usual passwd
command to change your password, it will only change the password of the rescue system. Your modifications are reset after a reboot. We will show you how to access your real files to change your password.
Before you start
To complete the actions presented below, you must have:
-
From the console, launch rescue mode.
-
Mount your partitions:
sudo mountall.shNote -
Chroot yourself into the root partition:
sudo chroot /mnt/sda2Note- If you installed your server with the default partition layout, the root partition will be mounted on sda2.
- If you configured custom partitioning, your root partition may be mounted elsewhere.
-
Use the following command to change the password:
passwdYou will be prompted two times to set the new password. While you are writing, nothing will appear on screen. This is a normal security measure.
TipIf you want to reset the password of a user other than root, use the following command, replacing USERNAME with the relevant username.
passwd USERNAME
-
Type
exit
when you have finished your modifications. -
Type the following command to finish:
sudo umountall.sh && sudo reboot -
From the console, click Boot in normal mode to reboot the server.
Your root password is now changed.