How To Enable or Disable Root Account In Ubuntu

Share
Ubuntu Root Account SettingsChange Ubuntu Root Settings

Hello everyone, in this quick guide, you will learn how to disable and enable root accounts in Ubuntu, with that said, I hope you are all having a great week so far. The weekend is just around the corner and I can’t wait! I feel like I need yet another vacation, anyone else feeling the same? This planet Earth will literally work you to death, I am right? Lol anyway, please read on…

Today we will teach you how to easily disable a root account and how to activate the root account if necessary. This is a guide that I believe any and all users of Linux should know. They might come a time when you must act fast and quickly disable root permissions in Ubuntu/Linux Mint/Linux. This tutorial will show you how to do this, the easy way, let us begin.

Disable/Enable Root Account In Ubuntu

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

Enable root account by giving it a password, type:

sudo passwd

When you enter this command you will be asked for new password. The password you enter will be the password for root account so be careful and choose a strong password.

Disable the root login, simply type:

sudo passwd -l root

This will disable the login using root user name i.e your system will be back to previous state.

Other Linux tutorials: Backup files on Ubuntu, How to update Ubuntu & How to optimize Apache