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.
- Open a Terminal Ctrl + Alt +T
- Type sudo su and then press enter.
- Next, type visudo and press enter (to access and edit the list).
- Using the up/down arrows, navigate to the bottom of the sudoers file that is now displayed in the terminal.
- Just under the line that looks like the following:
root ALL=(ALL) ALL
- Add the following (replacing user with your actual username):
user ALL=(ALL) ALL
- 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
How to add a user to the sudoers list published under Using and Configuring Linux