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

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?

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.