sudo password issue

Hello,


I upgraded to OS X Yosemite from Mavericks and my DBD::mysql driver for Perl seems to have gone missing. I am trying to reinstall through manual install using terminal utility (cpan install didn't work either), but fails in the last step "make install" with some permission issues. So I tried to do a "sudo make install" instead and at the password prompt, when I enter the admin password, it keeps saying "Sorry, try again". Then it bails out after 3 attempts.


I have tried changing the password from caps to lowercase to all numerals, but no password at the terminal prompt seems to work. However, when I reboot and go through the login window, it accepts admin password there.


I guess I have 2 issues here - first, why is sudo password at the terminal not working. It remains to be seen if my DBD::mysql driver will install once I am able to run "make install" as admin.


Cheers.

iMac, OS X Yosemite (10.10)

Posted on Nov 10, 2014 3:45 AM

Reply
16 replies

Nov 10, 2014 8:02 AM in response to bitsian

As standard OS X does not have the command line tools to compile and install software installed, therefore as standard make install will fail. If you did have the tools installed previously in Mavericks you probably need to download and install the Yosemite equivalent. However this would not seem to explain your sudo issue.


You could try the following


sudo su

make install


The first line changes you to a root session, the second will do the make install while in the root session.


If sudo su does not work make sure you are first logged in as an admin level user, either do a full login as an admin level user or do the following


su adminusername

sudo su

make install


Here the first line switches you to be running a session as 'adminusername' then presuming that really is an admin level user you can run sudo su.

Nov 11, 2014 4:00 AM in response to John Lockwood

Thanks for that quick response John.


I first opened Directory Utility and "Enabled Root User", assigned it a purely numeric password, then ran "sudo su" command from a standard (non-admin) user as instructed. It prompted for a password, but when I provide it, it says "Sorry, try again". Then I switched to my admin user and tried again, but with same results.


Strangely, I can switch from standard to admin user and vice-versa from a terminal window without any issues by doing the following -


su - <shortusername>


Then at the password prompt, I enter the appropriate password and am able to get into that user account. So it appears that sudo is the problem.


In the meantime, I found a way to get root access from the terminal (my iMac has 2 configured users: 1 standard and 1 admin) -


a. first enable root access from Directory Utility -> Edit

b. Switch to Login Window (you will see an option to Login using root - or any user really)

c. Use that option to logon as root

d. Once you are in, you can open a Terminal window.


I am planning to use this as a last option to execute that DBD's make install, if no other cleaner way exists. My worry being, if it installs as root and I have to run my perl scripts from a standard user account, whether I will have permission problems at runtime. Plus, I don't know if the scripts also come with a clean uninstall.


To answer your other question -


- I did install the latest version of Xcode after the Yosemite update, so I am guessing the command line utilities are installed. I also think if they weren't, I would have run into issues with DBD::mysql install in prior steps itself (involving other makefiles).


Anyone else reading this about DBD::mysql driver install problems on Yosemite, please let me know if you have had success with it. I have seen suggestions stating that one should install fink or use MacPorts, but after cursory reading of their installation procedures, it appears that setup will run its own makefiles. So I'd like to avoid those installs if I can. Even if I did, this driver install is the only reason I'd use it for, really.


Cheers.

Nov 13, 2014 3:56 AM in response to bitsian

Ok, I did what I said I didn't want to do, but it looks like my DBD::mysql problem is now solved.


I enabled root user as posted earlier, went in through the Login Window to logon as root and executed the final "make install" command as root (from the appropriate directory) and it worked!


Well, the DBD::mysql driver installation worked.


Then I disabled root user, went back in as a standard user and executed my perl scripts which use DBD::mysql to access my database - and everything works like a charm.


sudo password issue still remains though. Perhaps, if Apple is reading this, they should quickly provide a fix to what is clearly a bug in Yosemite!


I hope this post helps.


Cheers.

Nov 13, 2014 4:40 AM in response to Barney-15E

If it only affects me, that worries me even more. At least for now, I knew of one other post that came up on search for sudo password issues, but I can't seem to find that link anymore.


I also saw a few posts on issues with Terminal accepting hidden passwords. It seemed to suggest that sudo was not the issue, but the terminal window itself. It said that Terminal was capitalising the first letter of all words, and since it's masked, you can't see it. A reason why, I kept trying different passwords in my travails earlier.


FYI - I now think even "su" is inconsistent. Earlier in my post, I stated that "su - <user>" was not a problem to switch from standard to admin and vice-versa. But when I tried "su - root", it wouldn't accept terminal password.


Cheers.

Nov 13, 2014 3:40 PM in response to bitsian

It said that Terminal was capitalising the first letter of all words, and since it's masked, you can't see it. A reason why, I kept trying different passwords in my travails earlier.

I seem to remember that one had to do with a third-party text substitution program like Textpander (that’s an example. I have no idea which one of the text substitution programs it was.)

Nov 13, 2014 4:15 PM in response to bitsian

bitsian wrote:


FYI - I now think even "su" is inconsistent. Earlier in my post, I stated that "su - <user>" was not a problem to switch from standard to admin and vice-versa. But when I tried "su - root", it wouldn't accept terminal password.


Cheers.

That's because root user in OS X by default is disabled.


Like Barney-15E said, this bug (if any) only affects you: i have checked both sudo and su and works exactly as it should for me on Yosemite.

Nov 13, 2014 11:04 PM in response to iW00

Thank you for that clarification on "su - root".


I usually keep my iMac as lean and clean as possible by installing just what I need, so I think I can safely rule out any third party software install on the system is causing the problem.


For now, I have gotten around my original DBD::mysql manual install issue. And for any configuration changes, the popup window currently accepts my admin user and password, so I can continue using my iMac without any interruptions.


I can wait until the next release of Yosemite to see if that fixes the issue. Still can't figure out why it happens only with me though!


Cheers.

Jan 26, 2015 4:29 PM in response to astrobouy

John Lockwood's post gives key to the solution.

To use sudo in terminal in Yosemite you must be logged in as an admin user. If you are not, then in terminal you can switch to an admin account by just typing


login <admin user name>

<password>


If successful, the user name before command prompt in terminal will change to admin user's name and sudo will now work.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

sudo password issue

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