Report this

What is the reason for this report?

How to assign a password to root after instantiating a VPS with the SSH authentication option

Posted on January 6, 2021

After instantiating an Ubuntu VPS droplet, I found myself needing to terminate and start over because I could not get back to being root after su’ing to another user account. Then I realized I never assigned a password to root, I had chosen the SSH option on the ‘Create Droplet’ page. How does this happen what’s the proper way to deal with this?

My objective is set up a simple OpenVPN account. What is the simplest way to achieve this?



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!

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.

Hi @jk3505,

When you SU to a user from being root, you can also use the combination CTRL + D or type in exit so that you go back to the user you were before you used su.

Additionally, if you want to turn on password authentication, you’ll need to enable it from the file /etc/ssh/sshd_config. In that file search for PasswordAuthentication and change NO to Yes on it. Once you do, save the file and restart the sshd serivce

service sshd restart

Please bear in mind allowing PasswordAuthentication is considered somewhat of a security risk, especially if your root password is weak.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.