'username' is not in the sudoers file

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

  1. BabaG macrumors member

    Joined:
    Jan 5, 2007
    #1
    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?

    thanks,
    BabaG
     
  2. atszyman macrumors 68020

    atszyman

    Joined:
    Sep 16, 2003
    Location:
    The Dallas 'burbs
    #2
    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

    Joined:
    Jan 5, 2007
    #3
    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,
    BabaG
     
  4. Mars™ macrumors newbie

    Joined:
    Jul 29, 2009
    #4
    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

    Joined:
    Mar 8, 2009
    Location:
    Denver, CO
    #5
    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

    Joined:
    May 1, 2010
    Location:
    Carmel Indiana
  7. Hydramus macrumors member

    Joined:
    Jun 30, 2007
    #7
    "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

    jzuena

    Joined:
    Feb 21, 2007
    Location:
    Lexington, MA, USA
    #8
    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

    Joined:
    Feb 24, 2011
    #9
    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

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #10
    Nope, it's not. Otherwise you wouldn't need to be in the sudoers list.
     

Share This Page