Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    Ah! Looking in /etc/sudoers, I notice I've left a comment that I added the line Defaults rootpw Commented Dec 19, 2017 at 12:17
  • I don't think passwd -dl root is the right command actually. In fact, the man page specifically states that will not disable root: "Note that this does not disable the account. The user may still be able to login using another authentication token (e.g. an SSH key). To disable the account, administrators should use usermod --expiredate 1 (this set the account's expire date to Jan 2, 1970) Commented Dec 19, 2017 at 12:27
  • 3
    @Neil_UK also, never edit /etc/sudoers! Use sudo visudo to make any changes to that file. This answer should be what you need, but you might want to drop by our /dev/chat to make sure you don't break anything :) Commented Dec 19, 2017 at 12:29
  • @terdon, I don't think root is actually completely disabled by default on Ubuntu (and I suppose Mint follows), just password-locked. Making the account expired also might affect stuff like cron (it does for regular users, but I didn't test for root) Commented Dec 19, 2017 at 12:35
  • I think it is disabled (but I'm not sure either). Point is, this still allows the presence of the root account and since the manual specifically states it isn't the right way to disable, I figure we may as well do what it suggests. Then again, disabling root completely might not be the best approach come to think of it. There must be someone with UID=1 after all. Commented Dec 19, 2017 at 12:57