rss feed Twitter Page Facebook Page Github Page Stack Over Flow Page

Disable root account

Posted on Sunday March 13, 2016 by Eric Potvin

For security reasons, it is safe to disable the root account. Removing the account might not be a good idea at first, instead we simply need to disable it.

passwd --help | grep lock
  -l, --lock                    lock the password of the named account
  -u, --unlock                  unlock the password of the named account

To disable the root account, simply use the -l option:

sudo passwd -l root

If for some valid reason you need to re-enable the account, simply use the -u option:

sudo passwd -l root