Previous 1 2 3 Next 35 Replies Latest reply: Jun 12, 2015 7:45 PM by sunilfromnoida
sinjon2112 Level 1 (35 points)

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.



iMac, OS X Mountain Lion (10.8.1)
  • Barney-15E Level 8 (46,329 points)

    If you are getting only "Sorry, try again" it isn't accepting your password. I'm not sure why not.

    You might try changing your password and see if it will work.

  • sinjon2112 Level 1 (35 points)

    Thanks, I just tried that and I still get the same response.

  • Barney-15E Level 8 (46,329 points)

    Check in Console for messages relating to security or sudo and see if it notes anything irregular about your attempts to use sudo.

  • sinjon2112 Level 1 (35 points)

    This is the mesage that is generated in console after each attempt to use the sudo command.


    03/09/2012 11:57:38.143 sudo[29759]:    nigel : 1 incorrect password attempt ; TTY=ttys000 ; PWD=/Users/nigel ; USER=root ; COMMAND=/usr/bin/fing

  • Barney-15E Level 8 (46,329 points)

    I don't know of anything else to check.

    Can you try a very simple, but long (more than 8 character) password. See if that works.

    You can always change it back to something more secure. I'm just wondering if there is something in the password that is causing problems for sudo.

  • sinjon2112 Level 1 (35 points)

    Hi Barney, sorry for the delay in replying, I had to work away yesterday.


    Ok I tried changing my password to "qwertyuiop" but still no joy. Still getting the same response. I think I'll have to ring AppleCare and see if they can sugest anything, but I'm guessing the next step will be to create a new user account and see if the problem persists.

  • sinjon2112 Level 1 (35 points)

    Ha!, Well I took my own advice and created a new Admin account and gues what? Terminal accepts the password. Looks like my account is corrupt somewhere. Not sure if this means I need to move everything to a new account or if there are steps I can take to fix it. I'll try permisions repair first as that's the only thing that springs to mind right now.


    Thanks for your help.

  • Barney-15E Level 8 (46,329 points)

    The basic Repair Permissions in Disk Utility won't affect your user account.

    You can reset your home folder permissions by doing the following:

    Boot into Recovery HD (hold down cmd-r on start).

    When it boots up, go to the Utilities menu and select Terminal.

    Type resetpassword and hit return

    Select the volume (Macintosh HD by default)

    Select your Account

    Click the  Reset Home Folder permissions and ACLs button.


    You can quit and restart from there.

  • sinjon2112 Level 1 (35 points)

    Thanks Barney. That didn't work unfortunately. Looks like I'll have to move everything to a new user account

  • William Lloyd Level 7 (21,040 points)

    Note that the account and password you're using with 'sudo' must be an ADMIN user account.  Is the username/password that of an admin user, or a standard user?  If it's the latter, it won't work with sudo (sudo is short for "super user do" and a standard user is not a super user in any form of the word ;-)

  • sinjon2112 Level 1 (35 points)

    Hi William. Yes I'm running an Admin account. I've even tried logging into the other admin account and changing my account to standard, restarting, then changing it back to admin, restarting again to see if that would correct some missing permissions but no joy.

  • BobHarris Level 6 (17,734 points)

    Generally speaking, 'sudo' takes its clues from the /etc/sudoers file.


    Have you tried using System Preferences -> Accounts to reset your account's password?


    I'm assuming that you are specifying your logged in account's password for the 'sudo' password prompt.


    'sudo' does not need an enabled root account.  root can remain disabled.

  • sinjon2112 Level 1 (35 points)

    Hi Bob, thanks for looking. Yes I've done the whole password reset thing, both within System Prefs and also from the Recovery Disk utility and yes I am using the correct password for the logged in account.

    I did try enabling root user, just so I could execute the command, but that made no difference, it wouldn't accept the root password either.

    There must be something up with my user account as when I try the same command from my "stand by" Admin account, which I don't generally use, it works fine.

  • BobHarris Level 6 (17,734 points)

    Use the standby admin account to look at the /etc/sudoers file to see if there is anything amiss in the file 


    Wild guess/idea, check you home Folder's permissions to make sure the do not allow anyone else write access. I know ash refuses to do some things if it thinks someone could put a Trojan file in your home folder. Compare against standby admin.


    Check what groups you are in, and compare against standby admin


    id -a


    There is some difference between the 2 accounts, and what is in /etc/sudoers.

Previous 1 2 3 Next