A root user is the most privileged user on DigitalOcean Droplets and has complete power on it.
But, what if the root user loses or forgets the password? So, how do they login?
At Bobcares, we often receive requests from DigitalOcean Droplet owners to reset their root password as part of our Managed Cloud Services.
Today, we’ll discuss 2 different methods to reset the root password on DigitalOcean Droplets.
How to reset root password on DigitalOcean servers?
The steps to reset root password on DigitalOcean Droplets depend on the Operating System used. Let’s see these cases in detail.
1) From DigitalOcean Control panel
For most Operating systems like CentOS, Ubuntu, etc, our Hosting Engineers reset the root password from the DigitalOcean control panel.
In other words, we reset the Droplet root password from Access > Reset Root Password option in DigitalOcean control panel.
This will create a new password and send it to the registered email address of the customer.
2) From DigitalOcean Console
Unfortunately, the above method is not available on FreeBSD, Fedora servers.
So, our Hosting Engineers use a different approach to reset the password of these servers. Let’s see the steps in detail.
a) Power off the Droplet
The first and foremost step is to power off the Droplet.
Usually, our Hosting Engineers power off the server via SSH, as this ensures that all services are stopped before the server is shutdown.
For example, we use the below command to shutdown the server via SSH
shutdown -h now
But, in most cases, Droplet owners will not have access to SSH.
So, in such cases, our Support Engineers power off the Droplet from Power > Power off option in the DigitalOcean control panel.
b) Reboot the Droplet in Single user mode
Secondly, we must power on the system and boot it into single user mode.
Single user mode allows the root user to login without the password. Additionally, all file systems are mounted, but the network is not activated.
But, single user mode can only be accessed with a physical connection to the Droplet.
Fortunately, the Droplet Console comes here for your rescue, because the Droplet console emulates a physical connection to the server.
Our Hosting Engineers power on the Droplet, access the Droplet console and boot the system into single user mode.
It’s a bit technical task. Most importantly, we must boot the Droplet into single user mode before the boot menu times out.
That is, you have to do these steps within seconds, otherwise, you have to start it all again.
c) Re-mount the filesystem
Droplet owners will have access to a limited shell environment at this point.
However, the filesystem is in read only mode, so we need to remount the file system in read/write mode to reset the password.
Our Support Engineers use the following command to remount the filesystem in read/write mode.
mount -u /
This will give access to the database, containing system password.
Finally, we mount the complete file system using the below command.
mount -a
d) Reset root password
Once the filesystem is mounted, we set a new password for the root user using the below command.
passwd
Once done, we logout from the single user mode using the below command.
exit
Droplet will exit the single user mode and continue the rest of the normal boot process and users can login to the server with the new password.
[Trouble resetting your Droplet root password? Our Emergency Support team can fix this in minutes.]
Reset root password in DigitalOcean – Common failure points
Although the process to reset the root password involves a few steps, we often see problems reported by Droplet owners during password reset.
Let’s take a look at the top problems we’ve seen.
1) New root password doesn’t arrive in email
When resetting the root password from the DigitalOcean control panel, it resets the password and email to the customer.
But, we’ve seen cases where customers complain that they haven’t received the new password in email or the new password doesn’t work.
In such cases, our Cloud Experts will reboot the Droplet in recovery mode and reset the root password. And for this, we use the Recovery option in the DigitalOcean control panel.
2) ‘Filesystem is not clean’ error
Sometimes, Droplet owners get the below error when they try to remount the file system.
Filesystem is not clean - run fsck. : Operation not permitted
This is because Droplet owners sometimes hard reboot the server, which leads to inconsistent disk state that prevent normal mounting.
In these cases, our Cloud Experts run fsck on the server to fix the filesystem errors.
Since data corruption can occur while running fsck on active disks, we always take care to unmount the file system before running this command.
[And, do you need help to fix this error? Our Cloud Experts can help you here. We are available 24/7.]
Conclusion
In short, DigitalOcean Droplet owners can reset the root password from the DigitalOcean control panel or from the Droplet console. Today, we’ve discussed the steps to reset the root password using these 2 methods and the common errors that can occur during this process.
0 Comments