Rise Digitech
Rise Digitech

Reputation: 51

Not able to change password of root for digital ocean droplet

Login from root user and after that it's asking for change password I enter a current and new password but not working. login from consol entered a user name and password received on email after reset droplet password. It's asking - Changing the password for root. (current) UNIX password: Enter new UNIX password: Retype new UNIX password

Connection to xxx.xx.xx closed.

Upvotes: 5

Views: 8050

Answers (2)

user17512205
user17512205

Reputation: 31

I had the same issue and was able to fix it by using the recovery Digital ocean recovery boot option1.

So I was stuck in this loop where after resetting the root password and receiving the email and entering the same 2 times and then entering the new password the shell will reboot and the new password will not be set and no matter how many times I tried I had the same problem. So I was tempted to redo the droplet but since I had spent a lot of time building the same I did not want to redo the same work. So I tried the recovery option and it worked. I did notice that the file system was broken and fixing that and resetting the password which is one of the options I6 was able to reset the same. Hope this will help people who are in this situation.

Here are the steps which I followed

  1. Did a reset root password.
  2. From the recovery option I selected Boot from Recover ISO
  3. Power off the droplet and then power it on so it can boot from the ISO
  4. Then launch the recovery shell from the digital option.
  5. You will see couple of options like mount, fix file system, reset password
  6. I did fix file system option 2
  7. I then selected option 1 and then option 3 to reset the password
  8. Then I changed the boot option to boot from the hard drive
  9. Reboot the droplet by powering off and on the droplet
  10. After that I used the same password that I had set with the root user I was successfully able to log in.

Upvotes: 3

Joshua Craven
Joshua Craven

Reputation: 4565

Reset the Root Password

If you typically log in to your Droplet using a password, or if you have set a password for the root or a sudo user on the system, you already have the credentials you need to log in.

If you log in to your server using SSH keys and have not set up a password for the root account or a sudo user, you will need to use the DigitalOcean Control Panel to create a password for you.

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.

enter image description here


Note: Some operating systems use internally-managed passwords, which means you cannot reset the root password from the control panel. 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’ll need to take.


Click Reset Root Password to send an email to the address associated with your DigitalOcean account. You can use the password provided to log in to your Droplet through the console.

Log In with the Console

From the DigitalOcean Control Panel, first click the name of the Droplet you want to access, then select Access from the left navigation. Click the Launch Console button to open a web-based console session.

When the console opens, click the console screen and press ENTER to ensure that the login prompt has focus:

Screenshot of the Droplet console login prompt

At the login prompt, enter the user you want to log in as. This will typically be the root user or a user configured with sudo privileges.


Note:

If you type directly into the console, it may initially read your number keys incorrectly, as if the SHIFT key is pressed. For example, pressing the 2 key may enter @.

This happens only when typing. You can avoid the problem by copying the text, then pasting it into the console by pressing CTRL + v. You can also reset this behavior and ensure that your key strokes are being received correctly by pressing SHIFT and CTRL a few times, then testing your number keys again.


When prompted, enter the password associated with the account. For security purposes, as you type or when you paste, the password the characters will not be displayed and the cursor will not change.

Once you’ve entered the password, press ENTER. If this is the first time you’ve logged in after resetting the root password through the control panel, you will be prompted to enter the password again, then asked to choose a new password:

You are required to change your password immediately (root enforced)
Changing password for root.
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:

Once you’ve successfully entered your credentials and, if required, set a new password, you should be logged in to your Droplet. From here, you can reset misbehaving configuration files or services in order to restore network access.

Upvotes: 1

Related Questions