The LEGOers

Q: (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

Close

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

  • All replies
  • Helpful answers

  • by Barney-15E,Helpful

    Barney-15E Barney-15E Jun 27, 2016 2:52 PM in response to The LEGOers
    Level 8 (49,645 points)
    Mac OS X
    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.

  • by BobHarris,Solvedanswer

    BobHarris BobHarris Jun 27, 2016 6:12 AM in response to Barney-15E
    Level 6 (19,257 points)
    Mac OS X
    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.

  • by Luis Sequeira1,Helpful

    Luis Sequeira1 Luis Sequeira1 Jun 27, 2016 2:53 PM in response to The LEGOers
    Level 6 (11,760 points)
    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".

     

    Screenshot 2016-06-27 at 15.04.04.PNG

  • by The LEGOers,

    The LEGOers The LEGOers Sep 3, 2016 7:28 AM in response to Barney-15E
    Level 1 (8 points)
    Mac OS X
    Sep 3, 2016 7:28 AM in response to Barney-15E

    To clarify a bit:

     

    1) It is an admin account.

    2) There are a few partitions on it, but the partition I am using only has one user account.

    3) I got a Mac refers to I has a Mac, it has been bought for 21 months already and was bought as a new Mac back then.

     

    I will try your suggestions and get back to you about it. Thank you.

  • by The LEGOers,

    The LEGOers The LEGOers Sep 3, 2016 7:31 AM in response to BobHarris
    Level 1 (8 points)
    Mac OS X
    Sep 3, 2016 7:31 AM in response to BobHarris

    Indeed it is a member. Though if I restore it to factory settings because the sudoers file is corrupt, and restore it from Time Machine, the same bug will appear again. No restore, everything ok, restore and poof (admin is not in sudoers file)!

  • by Barney-15E,

    Barney-15E Barney-15E Sep 3, 2016 7:38 AM in response to The LEGOers
    Level 8 (49,645 points)
    Mac OS X
    Sep 3, 2016 7:38 AM in response to The LEGOers

    You are replying on an old, solved thread, not the one you created.

    Yours is here: Re: Admin account does not have sudo?