How to change the root password
This document shows you have to change your password using the rescue system. If we then try to use the usual passwd
command to change the password, you will only change the password of the rescue system. After a reboot your modifications will be reset. We therefore show you how to access your real files in order to change your password.
- You have an account and are logged into the Dedibox console
- You have created and installed a dedicated server
-
From the console, launch rescue mode.
-
Mount your partitions:
sudo mountall.shNote:The mounted partitions are available in the directory
/mnt
. This means, you find the partition/dev/sda1
mounted in/mnt/sda1
. -
Chroot yourself into the root partition:
sudo chroot /mnt/sda2
- 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.
Tip:If 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.