In order for a user to have root access in Linux, you have to add the user to the sudoers file. By default during a fresh new installation of Linux, the first user is automatically added to the sudoers list.
For newly created user(s), you will see the following error output when you try to gain root access:
XXXX is not in the sudoers file. This incident will be reported.
where XXXX is the username.
To add subsequent created users to the sudoers list, you must open and have root access to edit sudoers file in /etc. Find the following line:
# Members of the admin group may gain root privileges
Add the following line under the above line:
%user ALL=(ALL) ALL
where user = the username that you wish to grant root access to.
In the above example, the account user will have root privileges and you will be able to call the command sudo through terminal.













