sinjon2112

Q: Password not working with Sudo

Hi, I hope someone can help with this.

 

I'm trying to run a sudo command in Terminal and when it asks for my password I get "Sorry, try again".

 

My user account is set up as Admin and I've even tried enabling root user but that didn't make any difference.

 

The last time I tried sudo was in Snow Leopard and it worked fine. My current install was clean in Lion and then upgraded to 10.8 so there shouldn't be anything hanging around from the old 10.6 install.

 

Any suggestions as to how I can get my password to work would be appreciated.

 

Thanks

iMac, OS X Mountain Lion (10.8.1)

Posted on Sep 3, 2012 3:48 AM

Close

Q: Password not working with Sudo

  • All replies
  • Helpful answers

Previous Page 2 of 3 last Next
  • by sinjon2112,

    sinjon2112 sinjon2112 Sep 7, 2012 2:35 AM in response to BobHarris
    Level 1 (35 points)
    Sep 7, 2012 2:35 AM in response to BobHarris

    Hi Bob

     

    I've checked my Home folder permissions in Get Info and they are idetical to Admin standby user, ie "Username"(me) Read & Write, staff Read only, everyone, Read only. All the folders except Applications & Public have the red "no entry" icon in the bottom right corner when viewed in Finder from the Admin account.

     

    Below is the terminal output for id -a

     

    id -a

    uid=501(nigelmonks) gid=20(staff) groups=20(staff),12(everyone),33(_appstore),61(localaccounts),79(_appserverusr) ,80(admin),

    81(_appserveradm),98(_lpadmin),100(_lpoperator),204(_developer),401(com.apple.ac cess_screensharing)

     

    This is identical to the output for the Admin user account.

     

    And here is the content of the sudoers file

     

    # sudoers file.

    #

    # This file MUST be edited with the 'visudo' command as root.

    # Failure to use 'visudo' may result in syntax or file permission errors

    # that prevent sudo from running.

    #

    # See the sudoers man page for the details on how to write a sudoers file.

    #

     

    # Host alias specification

     

    # User alias specification

     

    # Cmnd alias specification

     

    # Defaults specification

    Defaults          env_reset

    Defaults          env_keep += "BLOCKSIZE"

    Defaults          env_keep += "COLORFGBG COLORTERM"

    Defaults          env_keep += "__CF_USER_TEXT_ENCODING"

    Defaults          env_keep += "CHARSET LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE"

    Defaults          env_keep += "LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME"

    Defaults          env_keep += "LINES COLUMNS"

    Defaults          env_keep += "LSCOLORS"

    Defaults          env_keep += "SSH_AUTH_SOCK"

    Defaults          env_keep += "TZ"

    Defaults          env_keep += "DISPLAY XAUTHORIZATION XAUTHORITY"

    Defaults          env_keep += "EDITOR VISUAL"

    Defaults          env_keep += "HOME MAIL"

     

    # Runas alias specification

     

    # User privilege specification

    root          ALL=(ALL) ALL

    %admin          ALL=(ALL) ALL

     

    # Uncomment to allow people in group wheel to run all commands

    # %wheel          ALL=(ALL) ALL

     

    # Same thing without a password

    # %wheel          ALL=(ALL) NOPASSWD: ALL

     

    # Samples

    # %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom

    # %users  localhost=/sbin/shutdown -h now

     

    Hope this is of some use, as I've no idea what I'm looking for with this

     

    Thanks again for your help.

  • by BobHarris,

    BobHarris BobHarris Sep 8, 2012 4:53 PM in response to sinjon2112
    Level 6 (19,662 points)
    Mac OS X
    Sep 8, 2012 4:53 PM in response to sinjon2112

    Everything you have just posted (id -a, /etc/sudoers) all looks good.

     

    And that fact that the alternate Admin account is working, I'm stumped.

     

    How have you reset your password?

     

    via System Preferences -> Accounts (maybe called Users & Groups) ?

    or from your terminal session using 'passwd'

     

    if you have tried one, then try the other?

     

    If you have any problems using 'passwd' from your broken account, you can also try it via your alternate Admin account

     

    alt_admin_account's_prompt>  sudo passwd broken_account_short_name

     

    I'll also ask some additional stupid questions.

     

    Do you use any corporate domain login stuff with this account?  That is to say, was this Mac hooked into your corporate single sign-on login system?  If this system is your home system and you did not play with any central login stuff, ignore this question.

  • by sinjon2112,

    sinjon2112 sinjon2112 Nov 21, 2012 4:56 AM in response to BobHarris
    Level 1 (35 points)
    Nov 21, 2012 4:56 AM in response to BobHarris

    I'm resurrecting this thread because the same problem has happened again.

     

    After trying all the suggestions above, thanks everyone, I finally gave in and did a clean install of Mountain Lion. I didn't migrate anything over from Time Machine or my clone, I just started from scratch and slowly started to add the apps I use the most.

     

    Just recently I needed to use the sudo command in terminal and the same old problem rears it's head, it asks for my password and when I enter it I just get "Sorry try again".

     

    This is only on my user account, which has admin privilidges. When I try on the "spare" admin account it works fine. Even more bizarre, I have three Macs and the same problem exists on all three. All three are running 10.8.2 and were all installed independently of each other.

     

    I'm really stumped/frustrated by this as it's obviously something to do with how I'm using/set up the machines or maybe a piece of software I run.

     

    If anyone has any ideas at all I'd be grateful. Thanks

  • by useEvil,

    useEvil useEvil Jan 1, 2013 10:37 AM in response to sinjon2112
    Level 1 (0 points)
    Jan 1, 2013 10:37 AM in response to sinjon2112

    This just started happening to me.  My admin account works because I can login with it and even unlock system preferences.  Just sudo does not work.  I've tried changing my admin password but that didn't work.  I tried creating a new admin acount and that didn't work either.

  • by ryman242,

    ryman242 ryman242 Jan 4, 2013 1:51 PM in response to sinjon2112
    Level 1 (0 points)
    Jan 4, 2013 1:51 PM in response to sinjon2112

    http://support.apple.com/kb/ht1528

     

    This seems so roundabout and silly, but it worked for me on Mountain Lion 10.8.2.

  • by Alberto Ravasio,

    Alberto Ravasio Alberto Ravasio Jan 4, 2013 2:25 PM in response to sinjon2112
    Level 5 (4,070 points)
    Jan 4, 2013 2:25 PM in response to sinjon2112

    If you type into Terminal

     

    id

     

    hit enter. Is your user member of 80(admin) group?

  • by christomcfisto,

    christomcfisto christomcfisto Apr 7, 2013 12:33 PM in response to Alberto Ravasio
    Level 1 (0 points)
    Apr 7, 2013 12:33 PM in response to Alberto Ravasio

    did you try "su root" instead of "sudo"

  • by sinjon2112,

    sinjon2112 sinjon2112 Apr 7, 2013 2:31 PM in response to Alberto Ravasio
    Level 1 (35 points)
    Apr 7, 2013 2:31 PM in response to Alberto Ravasio

    Hi Alberto Ravasio

     

    I'd pretty much given up on solving this issue until I got notified of a new post here.

     

    Just used the id command in terminal and my user is a member of 80(admin) group.

  • by sinjon2112,

    sinjon2112 sinjon2112 Apr 7, 2013 2:21 PM in response to christomcfisto
    Level 1 (35 points)
    Apr 7, 2013 2:21 PM in response to christomcfisto

    Hi christomcfisto, thanks for bringing this thread back to life.

     

    Just tried su root in terminal and after entering my password I get "sorry"

  • by sinjon2112,

    sinjon2112 sinjon2112 Apr 7, 2013 2:30 PM in response to ryman242
    Level 1 (35 points)
    Apr 7, 2013 2:30 PM in response to ryman242

    Hi ryman242 thanks for your suggestion.

     

    I tried enabling root user as per the article, then tried both sudo and su root commands.

     

    Both still return the "Sorry, try again" & "Sorry" response respectively.

  • by sinjon2112,

    sinjon2112 sinjon2112 Apr 7, 2013 2:37 PM in response to BobHarris
    Level 1 (35 points)
    Apr 7, 2013 2:37 PM in response to BobHarris

    Hi BobHarris, still struggling with this one.

     

    I tried changing my password in System Prefs> Users & Groups, but that made no difference.

     

    When I tried to change my password using "passwd" in Terminal, I got "authentication token failure"

     

    Any ideas?

     

    Just to cover your last point, none of my Macs have been linked to any corporate sign in facility.

  • by LA440,

    LA440 LA440 Apr 8, 2013 7:02 AM in response to sinjon2112
    Level 1 (0 points)
    Apr 8, 2013 7:02 AM in response to sinjon2112

    I have the same issue. Is this a mountain lion bug then?

  • by Alberto Ravasio,

    Alberto Ravasio Alberto Ravasio Apr 8, 2013 8:43 AM in response to christomcfisto
    Level 5 (4,070 points)
    Apr 8, 2013 8:43 AM in response to christomcfisto

    su root does not work if root isn't enabled.

     

    To become root you must issue

     

    sudo -i

  • by grumpy-bear,

    grumpy-bear grumpy-bear Apr 9, 2013 5:49 AM in response to sinjon2112
    Level 1 (0 points)
    Apr 9, 2013 5:49 AM in response to sinjon2112

    the same problem happened to me this week when I updated my system to mountain lion.

    no way to sudo any more

    my humble opinion is that mountain lion changed the way it handles the keyboard (I know because I am a VI user!) and my password has accented characters that are generated by double keyboard strike!

    what can I do? (I can't even cut/paste my password to sudo)

    tanks

  • by Topher Kessler,

    Topher Kessler Topher Kessler Apr 9, 2013 6:58 AM in response to sinjon2112
    Level 6 (9,866 points)
    Apr 9, 2013 6:58 AM in response to sinjon2112

    One thing you can try is to recreate the authentication authority entry for your user account. First be sure you have a backup of your system, and then log into the second admin account and open the Directory Utility in the /System/Library/CoreServices/ folder. Then click the Directory Editor toolbar button and then click the small black lock to authenticate. Then select your faulty user account from the list to the left, and then remove the AuthenticationAuthority entry in its entirety (usually two lines, one that mentions Kerberos and the other that mentions ShadowHash).

     

    Follow this by going to the Users & Groups system preferences, selecting the faulty account, and changing the account's password.

     

    See if that helps the system properly accept the passwords.

Previous Page 2 of 3 last Next