When you create a Droplet, you have the option to either add an SSH key to it or to choose a root password. If you forget or lose the root password, you can reset it using the DigitalOcean Control Panel.
Root password resets are not available for operating systems with internally-managed passwords, including FreeBSD, Fedora, and RancherOS. In these cases, you’ll see the following message in the Reset root password section:
This Droplet’s root password is managed internally and cannot be changed from the control panel. Please SSH into the Droplet to manage it.
See How to Recover from Lost SSH Keys for additional steps you need to take.
The standard way to reset the root password for your Droplet is using the control panel.
Navigate to the control panel. From the project the Droplet is in, or from the main navigation’s Droplets page, locate the Droplet. Click the Droplet’s name to open its detail page, then select Access in the left navigation.
Click Reset Root Password to reset the Droplet’s password. You will receive an email containing the Droplet’s temporary password.
When you log in to the Droplet with your new password via SSH, the operating system prompts you to change the password. It first asks for the current password (the new root password emailed to you), then asks you to enter the new password twice.
The standard root password reset process may fail if the Droplet’s disk is full or if there is a filesystem issue with the PAM subsystem. If you can’t reset the root password the standard way using the control panel, you can reset it using the recovery ISO.
Once you boot from the recovery ISO, use the Mount your Disk Image option, then select Reset Droplet Root Password.
In some cases, issues such as full inodes or full disk usage can affect the Droplet root password reset process. To check for these problems, use the shell option from the recovery ISO menu and check the /mnt
details for both disk space and inode usage:
df -h
df -i
If these are at 100% for the /mnt
path, which is your Droplet’s disk, explore the file system to clear some space before trying to reset the root password again.
If you can’t mount the disk image, you can use the Attempt to chroot
into installed system option, which brings you to a chroot
ed environment. Then use the passwd
command to change your root password. This functionally works the same way as the Reset Droplet Root Password option.
Once you have reset the root password and fixed any underlying problems, from the control panel, click Recovery and choose the radio button for Boot from Hard Drive. When you power the Droplet back on, it boots from its own disk, and you can log using the new root password you set.