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:
  • Restringed privileges
  • Logs of the actions done by users
But 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.


(1) Open a Terminal window.
(2) Go to superuser by typing "su" and then entering the password for root user.
(3) Now type "visudo" to open the sudoers file.
(4) You will see a file more or less like this.
# /etc/sudoers## This file MUST be edited with the 'visudo' command as root.## See the man page for details on how to write a sudoers file.#Defaults        env_reset# Host alias specification# User alias specification# Cmnd alias specification# User privilege specificationroot    ALL=(ALL) ALL
(5) Navigate to the end of file and add the following line :


where "USER" is the username you use as standard user.

(6) Save and quit. This should solve the problem.

Get Tech Updates via eMail :


  1. Yeah, that message IS frustrating. Thanks for sharing the fix! You've made some "sudo-frustrated" people happy. :D

  2. Yeah, that message IS frustrating. Thanks for sharing the fix! You've made some "sudo-frustrated" people happy. :D



About Tech Guru

TechGuru is a leading technology site, dedicated to software, gadgets, tech news and reviews. The site offers articles, tutorials and how-to guides on all things related to personal technology, desktop applications, productive online tools, social networking sites, windows, office etc.

Founded in 2007, TechGuru features audience who have the passion for Software and Technology and seeks to promote awareness about the internet and computing.

Get News on the Go

Mobile TechQuarkTech Guru is a mobile-friendly website. Simply bookmark in your mobile browser for free access anytime, anywhere.

Contact Us / Send a Tip

Use Contact Form, if you have Comments, Problems, Suggestions, Praise, Complains about the site. Your suggestions and articles are valuable to us.

Copyright © 2007- Tech Guru - All rights reserved. No part of this blog be republished or written without prior permission of the author

Privacy Policy | Disclaimer | Contact | Advertise With Us

Designed and Maintained by Shubham Gupta