How to remove "reset root password"?

July 17, 2015 1.3k views
Security API


Upon logging into a new droplet the first time via SSH using an SSH Key I am being asked to reset the root password - I would like to disable this. Is this possible?

My scenario is this.

1/ Create a new droplet with an SSH key from an image via Java Api (This image has all the correct sshd_config settings - PermitRootLogin without-password and PasswordAuthentication no
2/ SSH into this box via JSch Java Api and perform some operations.

Step 2 would not be possible if there is a prompt to reset the root password. I can verify that the SSH key is setup correctly because when I attempt to SSH to the box the first time I am not asked for a password.

Any help would be greatly appreciated.


1 Answer

Well, as I understand, there is no way to disable this root password reset feature. There is a script that runs on "every" DO droplet that is deployed which first generates a new password & then expires that password. So when you login, the password is expired and if you login through root, you will most certainly be forced to change your pass.

A workaround can be that you create another user with sudo privileges and login with that user. This way, even though root password has expired, the other user would still be working fine!

Hope this helps!

Have another answer? Share your knowledge.