You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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

Reply
Question marked as Top-ranking reply

Posted on Jun 29, 2013 6:13 PM

The problem (for me at least) is TextExpander. God knows how many times I have "nuked & paved" my Air in order to get rid of this problem.


TextExpander has a setting that capitalises the first letter of the first word of a "sentence". You type your password correctly & TextExpander cleverly capitalises the first letter. You can turn this feature off on an app by app basis in the Preferences.


If you are not using TextExpander then have a look at what else you are running that does something similar i.e. autocorrect or something like this.


I have conatcted Smile & also had this problem echoed at https://discussions.apple.com/thread/4607694?start=0&tstart=0 by joshsmith01.


Hope this helps.

35 replies

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.

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

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.

Apr 9, 2013 7:05 AM in response to grumpy-bear

grumpy-bear wrote:


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!


I created a new admin user and assigned to it the password èòàùç


sudo does not complain about the password.

Jul 1, 2013 4:19 PM in response to mchw

Thanks for the suggestion Mchw. I can't believe after all this time the solution has finally been discovered. It was exactly as you said, the problem was auto capitalisation in Text Expander. After quitting TE my sudo password worked, so I restarted TE then in TE preferences excluded Terminal.app from the auto capitalise function and everything is now as it should be. Thanks again for posting the solution.

Password not working with Sudo

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.