Confession. I know little about linux, am an XP refugee, and try to do things I don't understand. I generally find it easier to find out how to do things, than to understand whether I should be doing them in the first place.
I am using Mint 18. At my then level of understanding, it seemed that having the same password for sudo and my user account was less strong than having different ones. I now understand that root is disabled by default on Ubuntu/Mint intentionally.
After searching on the web, I did something to enable a separate password, not sure what, my notes aren't clear around that date, but I edited a file. Needless to say I can't remember exactly what search I was using to get me back to those instructions.
The result was that I was able to set a separate password for root, which probably means I enabled the account. Now when I sudo from the terminal, it requires the root password. When I do admin type things from the GUI, some things (update manager) need my user password and others (backup tool) needs the root password. As a result whenever a password box jumps up, I don't know which one it's asking for. If I understand correctly it's not improving security anyway, so I'd like to revert to how it was out of the box.
I've taken a full backup of my data to a different physical device, and if the worst comes to worst I can nuke and rebuild. After a bit of searching around, the following magic was suggested, sudo passwd -dl root
which is supposed to disable the root account.
Is that what I want to do? What's the worst that could happen? Will that leave me able to sudo with my main account password? Are there any investigations it would be prudent to do on my machine, existence of control files for instance, before trying this?
sudo ls
and ii)su
. Each of those commands should ask for a password. Thesudo
one should ask for your user's password, the one you use when logging in and thesu
one should ask for the one you set up for root. Can you confirm that this is indeed what's going on?sudo ls
andsu
only respond to the one that's set for root.sudo grep -E 'rootpw|runaspw' /etc/sudoers
. If either of those is set in that file, you would want to remove them as ilkkachu mentions below. Then you can decide if you also want to deactivate the root account. And no, the command you show won't do that, seeman passwd
(and notpassword
).