0

I already set-up my root password in Ubuntu. But for some reasons now I need to set it back to default as when Ubuntu is freshly installed. I no more need my set root password. How can I set it back to default? I know my root password. When I supply with empty password to set it back to default it says "Cannot be empty"

what I was trying to do..

David Foerster
  • 36,264
  • 56
  • 94
  • 147
ItsTheBat
  • 333

1 Answers1

2

To lock the root account, making it unable to login with a password, use this command:

sudo passwd -l root

It will retain whatever password you have set, but it will be unusable for all purposes.

EDIT: This will be useful for any account, besides root.

To unlock the password for the account you previously locked, use this:

sudo passwd -u root

BTW: as was commented, you shouldn't use the root account, unless you really know what you're doing.

philsf
  • 854