How to add a user to the sudoers list

How to add a user to the sudoers list so that we can give a user root access. Believe it or not, this is a fairly common question and in all reality the answer is quite simple. Adding a user to the sudoers list on a fully installed Linux system such as Ubuntu or Debian is possible via the visudo command. Users in the sudoers group are allowed privileges to run commands and open files as a root user or administrator. In the following, I cover the simple process of adding a new root user.

Adding a user to sudo group

Granting a new user root access and sudo privileges.

  1. Open a Terminal Ctrl + Alt +T
    Opening a Terminal
  2. Type sudo su and then press enter.
  3. Next, type visudo and press enter (to access and edit the list).
  4. Using the up/down arrows, navigate to the bottom of the sudoers file that is now displayed in the terminal.
  5. Just under the line that looks like the following:

    root ALL=(ALL) ALL

  6. Add the following (replacing user with your actual username):

    user ALL=(ALL) ALL

  7. Now press Ctrl+X and then press Y when prompted to save.

That’s it. Your new user now has root privileges!

New user with Root Access Granted

Adding a new sudoer

How to add a user to the sudoers list published under Using and Configuring Linux