9 Replies Latest reply: Dec 31, 2015 7:32 AM by Ian creating problems
macbookbro67 Level 1 (0 points)

YOU DO NOT HAVE TO RE-INSTALL MOUNTAIN LION -

 

If you find yourself locked out of your ML administrator account - and/or all other admin accounts and receive this message when entering the correct password: "You are unable to log in to the user account "xxxx" at this time. Logging in to the account failed because an error occurred" this is due to a misconfiguration in your server active directory set-up.

 

You need a new admin account - follow these directions to get yourself a new administrator level account on your mac with all your original files and settings intact - here we go:

 

STEP 1 BOOT INTO SINGLE USER MODE

 

Boot your affected Mac into Single User Mode by pressing Command + S at the chime

 

Note** if you are using rEFIt, highlight the icon which boots into the OSX installation you are currently locked out of and then press F2, nav down the menu options to Boot into single user mode and hit ENTER

 

STEP 2 MOUNT YOUR OS X INSTALLATION

 

Type: /sbin/mount -uw / at the prompt and hit enter.

 

STEP 3 TRICK OSX START UP INTO BELIEVING ITS BEING RUN FOR THE FIRST TIME

 

Type: rm /var/db/.applesetupdone

 

What this does is deletes a specific file OSX checks each time it runs to determine whether its running for the first time or if accounts have already been set up. By removing this file, when we reboot, OSX will assume this is a brand new set-up and will allow us to create new accounts.

 

STEB 4 REBOOT

 

Type: reboot

 

STEP 5 - SET UP A NEW ADMIN ACCOUNT --- BUT DO NOT USE THE SAME NAME AS ANY EXISTING ACCOUNT

 

If you use the name of an existing account, you will overwrite the files of that account. Just set up a new unique admin account and then log in.  once you are logged back into your Mac with administrator access, you can correct the issues which locked you out in the first place.

 

 

 

If this fails or you prefer another method of gaining access - I recommend the open source ophcrack application - it works pretty well too and detailed instructions can be found at SourceForge.

 

Hope this helps some of you experiencing some of the same ML and ML Server issues I am run into. Reformatting a partition is a last ditch solution.


iMac, OS X Mountain Lion (10.8.2), Works for Administrator Lock-Outs
  • AliBrownster Level 1 (0 points)

    Oh man, you are awesome!  Searched all over the net and tried countless other solutions, but this was the only one that worked!

     

    Little tip for those who use wireless keyboard (which doesn't work for logging into single user mode at startup).  If you have a PC keyboard then use the Windows key + s at startup.

  • kingfisher500 Level 1 (0 points)

    Do you know how to do this in Mavericks?

     

    The command "rm /var/db/.applesetupdone" gets the response "no such file or directory.

  • baltwo Level 9 (62,215 points)

    It should be the same. BTW, the file's named .AppleSetupDone, but case shouldn't be an issue. If you're getting that message, then the you don't have to remove it.

  • baltwo Level 9 (62,215 points)

    ls -al /var/db/ should show everything in the folcer.

  • kingfisher500 Level 1 (0 points)

    I tried again. I had left a space after "db/" and ".applesetupdone"

     

    I eliminated the space and changed the filename to ".AppleSetupDone" and it worked.

     

    I was unable to use my original password but, with a new one, I was able to log in. I was not, however, able to change the Home Folder, which is what I was trying to do when things went wrong.

     

    I have installed Mavericks on an external drive, which houses my Home Folder, and then do a clean install on this internal drive and use it as aan emergency startup drive.

     

    Thanks for your help.

  • baltwo Level 9 (62,215 points)

    thumbsup.gif

  • LauraleeG Level 1 (0 points)

    Hello. I tried this message to but the error transferred over to the new admin acct i created. I think the bug/error is on my time machine backup becaus i restored the files there ( so i coould have access to my files) and then i couldnt sign back in!!!  I wont do that again (restore from time macjine) but how do i "correct the issue that caused the error in the first place" when i dont know what that was?!?  Any help you could provide would be appreciated. Thank you.  

  • Zorro21c Level 1 (10 points)

    "...once you are logged back into your Mac with administrator access, you can correct the issues which locked you out in the first place..." The question is how to correct the issues?  I have three admin accounts in my mac.  Two accounts have no problem to log in so I can still use any as an admin account, but my main admin account is blocked.  It has iPhoto and Aperture albums which I like to retrieve. I used Time Machine to go bak but that still blocked me out of the main admin account. The photo albums in all I want.  Do you have any other tricks up your sleeve?  Thanks.

  • Ian creating problems Level 1 (0 points)

    I had moved my home directory to an external hard drive. A few years later, I changed to name of the hard drive using 'get info.' This is when things got screwed up and I started getting the frustrating message that I cannot log in to my account (Admin). However, when I log in as a Guest, I can make changes using my admin ID. So the computer recognizes my admin privileges under the Guest account!

     

    Solution: Revert the name of the hard drive back to the original name and everything worked as before. I guess I could have, instead, updated the file path but I was too frustrated to try anything new and adventurous.