Question

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

Posted January 6, 2021 134 views
Linux BasicsUbuntuQuickstart

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?

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.

×
1 answer

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.

Submit an Answer