'username' is not in the sudoers file

Discussion in 'macOS' started by BabaG, Jul 30, 2008.

  1. BabaG macrumors member

    Jan 5, 2007
    just was trying to run a sudo command in the terminal and got the error
    in the topic. what's that and how do i fix it? i'm guessing this would mean
    i could never run a sudo command. that's not good. help please?

  2. atszyman macrumors 68020


    Sep 16, 2003
    The Dallas 'burbs
    I'm willing to bet that "username" is a limited account. If you desperately need to run commands you don't have access too in the limited account you can su "admin account" and then sudo from there.
  3. BabaG thread starter macrumors member

    Jan 5, 2007
    thanks atszyman. that did it. i'm used to a little bit simpler su
    setup with my mandriva systems. don't use sudo there. still
    getting used to osx.

    thanks again,
  4. Mars™ macrumors newbie

    Jul 29, 2009
    I am using an admin account. (for the record I see no need for mulitiple accounts and wish I could just have full control over my own damn computer).

    I am getting this error and typing "su <my account name that is an admin>" in the terminal did nothing. =(
  5. jpyc7 macrumors 6502

    Mar 8, 2009
    Denver, CO
    I'm not sure if you can do "su", but you should be able to do "sudo". The "su" actually means you need the root password, which is not the same as that of your admin account.
  6. AirlinePilot macrumors newbie

    May 1, 2010
    Carmel Indiana
  7. Hydramus macrumors member

    Jun 30, 2007
    "su <account name>" would obviously do nothing if you are already logged into that account as su is 'substitute user' or 'switch user'. If you are still getting the 'not in sudoers file' error while using sudo, you may want to double check whether it actually has admin rights.
  8. jzuena macrumors 6502a


    Feb 21, 2007
    Lexington, MA, USA
    For laughs I looked at /etc/sudoers on my mini (you need to use sudo to look at the file and technically its in /private/etc/sudoers but /etc has a softlink to /private/etc) and it looks like OSX uses a standard sudo setup. Both root and any admin accounts get full access to all programs after giving a password. You could add any account to the sudoers file using sudo visudo (using terminal from an admin or other account already able to use sudo) and adding a line for "username" in the user privilege specification section:

    # User privilege specification
    root ALL=(ALL) ALL
    %admin ALL=(ALL) ALL
    username ALL=(ALL) ALL <-- added line

    You can also lock down "username" to only have access to certain commands through sudo. Google would be more helpful than the OSX man pages for that.
  9. megaman1522 macrumors newbie

    Feb 24, 2011
    Hepl please

    i need to put my limited user in sudoers file withought using admin account password.? this has to be possible. right ????
  10. angelwatt Moderator emeritus


    Aug 16, 2005
    Nope, it's not. Otherwise you wouldn't need to be in the sudoers list.

Share This Page