I found a bug when I followed the first steps to creating a securing the server.
You don’t know the password for root when creating a droplet with an ssh key
sudo
with the new userYou’re asked to enter a password for root
but DigitalOcean didn’t send the password by email because I created the droplet with an ssh key.
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.
Hey there,
That’s not really a bug: it works this way across pretty much every Linux distribution. “sudo” asks for the current user’s password (if a password at all), not the root password. “su” is what asks for the root password.
Generally, what we recommend is setting a password for the new user when you create the root user, but keeping passwords disabled over SSH. This way, you have a password you can use when sudo-ing and logging in through our VNC Console, but SSH remains secure. That’s how I set up most of my droplets, and it works quite nicely.
I hope that helps! :)
Best, Eris Platform Support Specialist
You have to exit your login session and re-login in in order to pick up the new sudo group membership permissions. (or use Userify, but that will only do the user creation part… disabling root is still recommended.)
I just noticed the option to reset root password from
Access
menu of the droplet.Yes I added the new user to
sudo
group, but without a password.I created a
.ssh
folder on the home directory with aauthorized_keys
file containing my public keyWeird since it should ask password of the new user… Is that username on sudoer list?