Resetting the password

Last change on 2026-06-02 • Created on 2026-06-02 • ID: CL-98866

If you can no longer access your server because you lost your root password, you can regain access by changing the root password on the server.

To change the root password in Hetzner Console, select the server, navigate to "Rescue" and select "Reset Root Password".

To change the root password via the rescue system, do the following:

  1. Enable the rescue system

    As explained in this getting started:

    • Select the server
    • Navigate to "Rescue" and click on "Enable rescue & power cycle"
    • After the reboot, connect to the server as root user.

  1. Create a chroot environment

    Run lsblk and identify the name of the root partition (e.g. sda1).

    Mount the root partition into /mnt and create the chroot environment:

    Replace sda1 with the name of your root partition.

    mount /dev/sda1 /mnt
    chroot-prepare /mnt
    chroot /mnt   

    You can now navigate through the file structure of your server's primary disc.


  1. Change the root password

    passwd

    After you changed the password, you can run exit to leave the chroot environment.


  1. Restart the server

    Restart your server to leave the rescue system:

    reboot

After reboot, you should be able to log in as root using the new password.