4

It is said to be more secure. Having root with a password, how do I revert it to be empty?

This documentation is pretty explanatory: https://help.ubuntu.com/community/RootSudo

And the command would be sudo passwd -dl root

But I can not play around on these servers and I would like to know if this command is the right one to reset root to a empty password, just like at Ubuntu 14.04 (server) installation.

1 Answer 1

4

There's a difference between "empty" password (or no password - when you get asked for a password you type nothing and hit enter) and a locked account.

The "root" user on Ubuntu systems is locked by default, that means there is no password at all that would match, not even the empty password.

Your command sudo passwd -dl root is correct:

  • The -d flag deletes the password, that means it reverts the password to the empty password. You log in by simply hitting Enter without typing anything.
  • The -l flag locks the account. It adds a "!" character in front of the stored encrypted password hash. This way, no entered password can match any more, because "!" would normally not appear in any hash of the used type. That means it becomes impossible to log in using a root password.

You should use both -d and -l (or short -dl) together because otherwise your current password would still be saved. If someone unlocks the account later and the current password wouldn't have been deleted, that's what the new password would become. If you could not remember the old one then, you would wonder why the root account is still not accessible until you figure out that there could be an old password set and you would have to reset it somehow again.

1
  • Wonderful! Many tanks (:
    – aPugLife
    Mar 2, 2016 at 9:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .