Thursday 30 August 2012

User is not in the sudoers file. This incident will be reported

On using the sudo command if we see the error message:
 
"User is not in the sudoers file. This incident will be reported."

This means that the user as whom we have logged in and are trying to run the command "sudo" does not have the permission to do so.
Only the users listed in /etc/sudoers have the permission to use the command "sudo".
To give the sudo permission to a user we need to add the user to the file /etc/sudoers file.
Open the file /etc/sudoers as root.
 
$sudo vim /etc/sudoers

Add the line
 
username ALL = (ALL) ALL

under the User privilege specification section.
Save the file and exit, now the sudo command should work for the user which was added in the file.

No comments:

Post a Comment