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.
Logged into your server in the Rescue System via SSH (Secure Shell).
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:/#.
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.
While you type, it is normal that no characters are displayed.
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.
Once the new password has been accepted and set successfully, type exit to leave the chroot environment and return to the Rescue System.
Unmount all the drives by typing umount -al and press ENTER.
Type mount more to ensure that /dev/mdX, /dev/sdX or /dev/hdX devices are not mounted.
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
For additional information, you may want to reference: