1and1 Help Centre Categories

print article

Reset a Lost/Forgotten Root Password

For 1&1 Dedicated Server Linux

Learn how to set a new root password for your 1&1 Dedicated Server Linux if you have lost or forgotten it.

If you have forgotten your root password, it is possible to change it via the Linux Rescue System via chrooting.

Step 2
Logged into your server in the Rescue System via SSH (Secure Shell).
Step 4
Change root directories to the /mnt/ folder which is the root partition of the hard drive. Type chroot /mnt and press ENTER.
The command prompt will change from rescue:~# to rescue:/#. Changed directories
Changed directories
Step 5
All following commands will alter the hard drive data. Type passwd to set a new root password. At the New UNIX password: prompt, enter the password and press ENTER.
Please note:
While you type, it is normal that no characters are displayed.
New password
New password
Step 6
You are prompted to retype the new password again. Type the new password once more and hit ENTER when you are finished. If the passwords match, you will be informed the new password was set. If they do not, re-enter the password. Password repeated
Password repeated
Step 7
Once the new password has been accepted and set successfully, type exit to leave the chroot environment and return to the Rescue System. Exit command
Exit command
Step 8
Unmount all the drives by typing umount -al and press ENTER. Drives unmounted
Drives unmounted
Step 9
Type mount more to ensure that /dev/mdX, /dev/sdX or /dev/hdX devices are not mounted. Re-mount drives
Re-mount drives
Step 10
Type shutdown -r now to reboot the machine. Afterwards, boot the system back into the normal mode via the Recovery Tool in the 1&1 Control Panel. Rebooting of machine
Rebooting of machine