The sudoers file is a file which tells the system what users can make use of the command “sudo”. If you try this command and your user isn’t authorized, you will get this error:
1 | User not in the sudoers file. This incident will be reported |
User not in the sudoers file. This incident will be reported
To give him privileges you have to know the root password or you need the Systems Administrator. Then, use the following commands:
1 2 | su nano /etc/sudoers |
su nano /etc/sudoers
Then, find the “# User privilege specification” and insert your user (for example, user1):
1 2 3 | # User privilege specification root ALL=(ALL:ALL) ALL user1 ALL=(ALL:ALL) ALL |
# User privilege specification root ALL=(ALL:ALL) ALL user1 ALL=(ALL:ALL) ALL
Then, come back to your user:
1 | login |
login
Now you can use the command “sudo” anytime you want.
Good coding!