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 for root not working

Hi,


The password for my root has stopped working. No matter how many times I change it within my Admin account, it doesn't work. I enabled the root account for the first time today and I could log in just fine. Then I disabled the root user.


I need to access the root again so I re-enabled it and tried accessing it. It wouldn't let me in. So I changed the password within my Admin account and tried again. No luck. It does not give me any error message while changing the password but no matter how simple a password I use, now it won't let me log in as root.


What am I doing wrong?


PS. The only major thing I did was to empty the DNS cache but don't think that should matter, right?

MBP 15", Mac OS X (10.5.8)

Posted on Aug 19, 2011 6:16 PM

Reply
62 replies

Dec 21, 2011 9:33 AM in response to patrix99

Following the suggestion of my Apple Higher Ed tech rep, I think I have a solution for the Only One TimeRoot Login problem.


What he suggested, and it worked great for me, was to be logged in as an Admin, go to Terminal and enter the following command `dsenableroot'. You will have to enter the Password for the Admin account you are logged in and then the Root password and verify this root password.


When I did that I could then login as Root with no problem. Even better, I could disable Root. and, even using the Directory Utility/Edit/Enable root, I could enable Root again and sucessfully login.


This process even survived a Restart with Root disabled and then enabled and Root account worked fine.


It appears that something in the process used to get from Directory Utility to the actual command to enable/disable Root at the machine level is broken. This does not surprise me since the Directory Utility was also broken in 10.7.0 and 10.7.1 when trying to use an Active Direectory connection. It looks like they blew up the Directory Utility when they re-wrote the Lion version.


Give it a try and see what happens for you.


On the minus side, when I went to update the Bug Report I finally got in yesterday, and received a Bug Report confirmation and number, well there was no record of my report. It looks like the Bug Report entry system is buggy all by itself!

Dec 26, 2011 2:20 AM in response to Joe Pyrdek

Thanks Joe - This resolved the problem for me.


To clarify, I'm running a mid 2011 15" MBP with 10.7.2 and was having the same problem as those described by the original poster - I managed to use the root account once but subsequent attempts to enable it through the UI were met with failure.


The above terminal workaround worked for me.

Jan 6, 2012 1:51 AM in response to quicksilver8

Had the same problem and used the same solution (CMD-R, etc.). This did not solve any of my problems as the system still did not recognize my password and I had to re-install 10.7.2 all over again.


After that I was able to log into my admin account, however now, whenever I want to install any programs or updates, Lion does not recognize my admin or root passwords although I have never changed them. I did try to reboot, which brought me to problem #1...Lion did not recognize my login password...re-install again...login OK, but again Lion does not recognize passwords. This is a catch 22 situation and it is quite seriously driving me mad. At this point I have to keep my MBP always charged because if I do not and it has to be rebooted, I will again not be able to log in.


This sort of stuff should have been sorted out by Apple before releasing Lion. I hope they quickly realize that many of us depend on their Apple products to do business!!!


P.S. My terminal.app does not work either!!!

Jan 6, 2012 6:32 AM in response to etresoft

You have got to be kidding me. Erase disk? I sure did not pay for an upgrade that went perfectly fine just to find out that I am unable to: login, delete my files, install programs, upgrade programs, etc. etc. etc. just because Lion does not want to accept the same password I have been using on all my current and previous systems for the past 20 years!


Don't take this personally as you seem to know your stuff, I just cannot believe that Apple would release a new OSX without ensuring all the basic stuff (accounts, passwords, old document files, previously installed programs, etc.) is fully operational after the upgrade.

Jan 6, 2012 6:40 AM in response to Emirates2005

Have you been through this procedure (sorry, I've lost track, there's several different people's problems going on here), posted by Quicksilver 8 earlier?


quicksilver8 wrote:


Try this:

  1. Restart in Single User mode (hold Command-S during startup). Note that single-user mode always uses the US English keyboard layout.
  2. At the prompt, type this followed by Return: mount -uw /
  3. Type this:

launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist

  1. Press Return
  2. Type this, then press Return: ls /Users
  3. Look at the listing and note the short name (username) of the affected user account.
  4. Type this:

    dscl . -delete /Users/username AuthenticationAuthority

    Note: Replace "username" with the affected user account's short name you noted above.
  5. Press Return
  6. Type this, followed by Return: passwd username

    Note: Replace "username" with the affected user account's short name you noted above.
  7. At the "New password:" prompt, type the user's password, then Return. Note: It is recommended that the original user's password be used to match the keychain password.
  8. At the "Retype new password" prompt, type the same password, followed by Return.
  9. Type this, followed by Return: reboot


If this doesn't work, go again into Recovery mode and reinstall Lion. I've already tried this, no fear. Reinstalling (it's quite long...) was successful, and Lion got in the same condition, with no need to configure preferences and apps.

Jan 6, 2012 7:02 AM in response to softwater

Hiya!


Followed the process you copied to the tee.


First of all, the system did not find the plist for DirectoryServices.


Since I do know the username I proceeded with deleting the authorization.

Result: DirectoryServices.plist not found


Then I tried with 'passwd...'

Result: eServer error


Rebooted and I cannot log in again...now re-installing 10.7.2 for the 5th time.

Jan 6, 2012 7:13 AM in response to Emirates2005

Emirates2005 wrote:


Hiya!



Since I do know the username I proceeded with deleting the authorization.


Err...no. You can't do that. It's a bit too late now, but you find the user names by simplying typing


users


or


finger


in Terminal.


A re-install is indeed your only way forward. BTW, since you've had so many dud installs, I highly recommend that you do not use any previously downloaded installer or recovery partition (as a matter of coincidence, I did 5 installs myself before getting a good one...).


Instead, download a fresh copy of the installer from the App store. Don't balk at the couple of hour wait...think how many hours you've wasted installing from what is most likely a corrupt installer and recovery partition to start with... 😉


Good luck.

Jan 6, 2012 7:28 AM in response to Emirates2005

Emirates2005 wrote:


You have got to be kidding me. Erase disk?

No kidding. Unfortunately, you are posting in an old, long thread that has long since ceased to be of any value. It is always preferable to start your own question so people will look at it without having to go through other people's baggage and dirty laundry.


Given how little I know about your system and problem, and the fact that you are in this thread, makes me want to provide the most likely-to-be-successful, and easiest (for me), solution.


Apple has made the OS reinstall process fairly painless. One way they have accomplished that is by not doing a thorough job. If there is something seriously wrong with your system, just reinstalling the software and copying back over the same old, incorrect, configuration files isn't going to help.


I sure did not pay for an upgrade that went perfectly fine just to find out that I am unable to: login, delete my files, install programs, upgrade programs, etc. etc. etc. just because Lion does not want to accept the same password I have been using on all my current and previous systems for the past 20 years!


That sure doesn't sound like the upgrade went perfectly fine. You are describing an update that went totally wrong.


Don't take this personally as you seem to know your stuff, I just cannot believe that Apple would release a new OSX without ensuring all the basic stuff (accounts, passwords, old document files, previously installed programs, etc.) is fully operational after the upgrade.


They didn't. Don't take this personally, but most likely you are the cause of the problem. I've screwed up my system many times before. I'm not trying to be hurtful, just trying to get you running again.


No one, anywhere, needs the root user. The fact that you have messed with something like that means that all bets are off about what is wrong with your system. If someone wants to try to walk you through DirectoryServices, fine. I don't know directory services well so I'm not going there. I am confident that if you erase your disk, reinstall the OS, reinstall your applications, and migrate only your user documents, you should be up and running again in a couple of hours.

Aug 3, 2012 9:09 AM in response to patrix99

I didn't read all the posts so somebody may have said all this. I'm running 10.7.4


There is a difference between su/root and sudo. When you su, thats logging in as root. When you sudo you are executing a single command with Super User privileges. sudo uses your credentials to allow you to execute a command.


You can set the root password when logged in as an admin through System Prefrences\Users and Groups\Login Options\Network Account Server Join\Open Directory Utility\ Click Edit in the menu bar and enable root.


You can login as root by choosing Other at the login screen. There is no happy little icon so chose other and type it in.


As a normal user you cannot sudo by default. To sudo you need to be added to the /etc/sudoers file. In order to edit this file correctly you need to login as root from the login screen. Open a terminal and run visudo. It's CRITICAL to run it in visudo because you can corrupt this file and it's permissions if you don't. If you do something wrong it will tell you and it's your fault if you save it at that point.


Add your normal user account to the sudoers file by copying the line "root ALL=(ALL) ALL" and pasting it below the %admin line. You can do the copy and paste by highlighting and right clicking if you don't know VI commands. Change root to your username and the write quite the file. THE FILE IS CASE SENSITIVE. If your username utilizes capital letters use them, if it doesn't have capital letters don't add any.


Restart the machine for good measure.


Login as your normal user. Open a terminal and sudo some task. When asked for the password enter the password for your normal user. Note the password is your password not root password.


For those that didn't assume you knew everything and already stopped reading here is some more.

As a normal user you cannot su don't waste time. You shouldn't run as root unless you really have to. With sudo you can do everything you could with root one command at a time. If you had to read this post to figure everything out and how to do it, DON'T USE ROOT unless you absolutely have to.


Hope this helped.

Password for root not working

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