Question

Root Password for VPS created with Predefined SSH Keys

A DO article states:

When you create a new VPS, you can choose to include that public key on the server. No root password will be emailed to you and you can log in to your new virtual private server from your chosen client. If you created a passphrase, you will be prompted to enter that upon login. (https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2)

The problem is the DO Droplet Console requires a root password.

  1. How do you get the root password?
  2. Other available work arounds?

thank you


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Here are the steps taken to resolve this issue based on ryanpq’s response.

  1. Update your SSH to not require a password. This will require the following file be edited:
/etc/ssh/sshd_config

The parameter for PasswordAuthentication should be commented out and set to yes. This will need to be uncommented and changed to no.

Should read:

#PasswordAuthentication yes

Change to:

PasswordAuthentication no

After saving changes, restart ssh

service ssh restart
  1. Now add a password to the root userid. Enter the following command:
passwd

The command will prompt you for the new password and a duplicate new password to validate.

Now you can access the console from the droplet menu and have passwordless access via SSH.

Ryan Quinn
DigitalOcean Employee
DigitalOcean Employee badge
October 11, 2016

With a droplet using ssh-keys you will need to log in via ssh with your key the first time. You can then run passwd to set a password for the root user. As long as your ssh configuration doesn’t allow for password authentication you can use the password you created to access the console (your droplet sees this as a local keyboard and display) but not to create a remote ssh connection.

Edit - follow this only if you can’t access SSH, if you can SSH follow @ryanpq answer

As you said when you create Droplet with public key included, root password will not be emailed. Without root password you can’t login into console. There is one workaround:

Go to DO Control Panel. Select your Droplet. From right menu select Access option. On that page you will have Reset root password button. Click on it, it will power off your Droplet and root password will be emailed to you.

With that password you can use console to login with username: root password: emailed one

Warning: it will power off your Droplet before resetting root password, so some downtime will occur. Process usually lasts only few seconds

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel