Fix "Not in Sudoers file" Error in Linux

"Sudo" is a commonly used command in Linux. Two of the best advantages about using sudo are:
STEPS :
where "USER" is the username you use as standard user.
6. Save and quit. This should solve the problem.
Restringed privilegesBut sometimes it you try to accomplish a task using Sudo command, you get an error message saying : " is not in Sudoers File". This can get quite frustrating as depicted in the pic. The file /etc/sudoers, has the rules that users have to follow when using sudo command, and this error arises when you user name is not in that file which restricts you to use that command. Here is a solution for the same.
Logs of the actions done by users
STEPS :
- Open a Terminal window.
- Go to superuser by typing "su" and then entering the password for root user.
- Now type "visudo" to open the sudoers file.
- You will see a file more or less like this.
# /etc/sudoersDefaults env_reset
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#
# Host alias specification5. Navigate to the end of file and add the following line :
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL) ALL
USER ALL=(ALL) ALL
where "USER" is the username you use as standard user.
6. Save and quit. This should solve the problem.















0 comments:
Post a Comment