(Admin) is not in the sudoers file. This incident will be reported.

So I got a Mac on OS X El Capitan and I am having trouble using sudo from the admin; yes the main admin, I repeat, ADMIN account. Each time I use a sudo command the error message pops up.

"(Admin name) is not in the sudoers file. This incident will be reported."


How can I fix this? This ain't ordinary.

MacBook Pro with Retina display, OS X Yosemite (10.10.5), Once running OS X El Capitan Beta

Posted on Jun 27, 2016 4:18 AM

Reply
6 replies

Jun 27, 2016 2:52 PM in response to The LEGOers

First, there isn't a "Main ADMIN"--it ain't Windows. Any user can be set to administer the Mac. Nothing is special about the first one.


As to the sudoers file, if you don't have an account that can access it (which your admin, I repeat, ADMIN cannot), you can't edit it.

There are a few ways to create a new admin account. Here is one: http://apple.stackexchange.com/questions/164331/i-dont-have-administrator-accoun t-on-my-mac


When you say, "So I got a Mac..." Do you mean you got a Mac from someone else, used?

If so, then you should just boot into Internet Recovery, Erase the disk completely, and reinstall OS X. That will fix the problem you have and any others left by the previous owner.

Jun 27, 2016 6:12 AM in response to Barney-15E

Is the account you are using a member of the 'admin' group

id -a

look for '80(admin)' in the list of groups.


If not, then check System Preferences -> Users & Groups to see if 'Admin' is listed under the account username.


If your account is a member of the '80(admin)' group, then your /etc/sudoers file is corrupt. You will need to restore this from a backup, most likely from Recovery mode, as it is unlikely you have permissions to become root any longer.


This is mostly making guesses, and trying to answer future questions, so it is very possible my ability to predict the future is not working very well today. Please correct any bad guesses.

Jun 27, 2016 2:53 PM in response to The LEGOers

Are you absolutely sure that your account has administration privileges?

By default, the first user account created is an administration account, others may or may not be.


The message you received is a standard Unix message for when a non-admin user tried to use sudo.


You can easily check if that is the case: Go to System Preferences->Users & Groups and see which accounts are "Admin", "Standard" or "Managed".


User uploaded file

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

(Admin) is not in the sudoers file. This incident will be reported.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.