• missing xbfish.com image

[Linux] Add user to Sudoers file

missing xbfish.com image
Posted on

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Spam protection by WP Captcha-Free