Skip navigation

How do I restore admin control after deleting the admin user?

1072 Views 7 Replies Latest reply: Apr 7, 2012 9:58 AM by Mcadol RSS
news33 Calculating status...
Currently Being Moderated
Apr 1, 2012 5:16 PM

I was working to erase extra users to free up space on my iMac.  I mistakenly threw away the admin.  now the computer is locked up and I am unable to take the content off the machine for a clean reinstall.  Is there a way to access the machine threw the Root User or Super Administer to recover control of the machine and make another user the admin of the machine?  I am able to login and logout out to different users.  Please help!

iMac, Mac OS X (10.5.8), MW
  • John Galt Level 7 Level 7 (33,010 points)

    Edit: Read and follow this before proceeding below the line. I do not believe it will work because you have no admin accounts, but try it anyway:


    Mac OS X: Changing or resetting an account password



    What you did is not supposed to be possible, but the impossible continues to amaze me.


    Try this:


    Boot single user mode:


    at the prompt type the following (copy and paste to avoid mistakes)


    mount -uw /


    then type




    at the prompt enter a new password for the root user (nothing will echo to the console) then type




    Log in, enter your account settings and use the user name root and the password you created for it. Change your account type back to admin.


    This should work.


    You should disable the root user after this but I need to research that. At least this ought to get you started.


    Some of the information in this KB article may be useful. It applies to earlier OS versions, but as I say you accomplished the impossible to nothing else seems to apply.


    Message was edited by: John Galt

    MacBooks  iMacs  iPods  AirPorts, Mac OS X (10.7.3),  27 years Apple!
  • Linc Davis Level 10 Level 10 (107,375 points)

    Launch the Terminal application in any of the following ways:


    Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)


    In the Finder, select Go Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.


    If you’re running Mac OS X 10.7 or later, open LaunchPad. Click Utilities, then Terminal in the page that opens.


    Drag or copy — do not type — the following line into the Terminal window, then press return:


    dscl . -read /groups/admin GroupMembership


    Post any lines of output that appear below what you entered — the text, please, not a screenshot.

  • Linc Davis Level 10 Level 10 (107,375 points)

    That means you deleted the admin group itself, and who knows what else. The following might work.


    Back up all data, then boot in single-user mode. When the text stops scrolling, follow the prompts to make the boot volume writable. Then enter the following command:


    ls /var/db/.AppleSetupDone


    You should get the following line of output below what you entered:




    If you do, then very carefully enter the following command:


    rm !$


    Now you should get the following output:


    rm /var/db/.AppleSetupDone


    Then enter




    The system will boot into the Setup Assistant, as if you were setting it up for the first time. Create a user with the same name as the old admin user. Log in and test. I'm not sure what will happen to your other user accounts, if any. You may need to recreate them.

  • Mcadol Calculating status...

    I have the same the same problem but probably easyer to resolve. Introducing the phrase you give to us <dscl . -read /groups/admin GroupMembership> the answer in my old Power G5 which I would like to get alive again terminal abswer is  root. That means the only admin in that computer after cleaning and deleting a lot of things is the system. My account is standard as I see in Prefs > accounts.


    The question is simple. How can I give admin privileges to myself? I don't remember the original admin name and I have reset the password of my standard account, giving too a password for removing firmware. Probably i forgot to select the hard disk when reseting the password.


    Would you kindly help me , please?

  • Mcadol Level 1 Level 1 (0 points)

    Solved by myself after ard naviation trouh Apple Kdb documents.

    I'm very happy now.

  • Mcadol Level 1 Level 1 (0 points)

    working again


More Like This

  • Retrieving data ...

Bookmarked By (1)


  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.