Announcement: Upgrade to macOS Mojave

With features like Dark Mode, Stacks, and four new built-in apps, macOS Mojave helps you get more out of every click. 
Find out how to upgrade to macOS Mojave >

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


Question: i deleted my administrator account and now i cant login to make any changes

In an attempt to change the admin user name, i seem to have made a mistake where i am no longer able to make any admin related changes, updates or installs. I have tried most of the methods suggested via Terminal, but if anyone has dealt with a similar issue, would appreciate the help. For reference, see attached diagram.

User uploaded file

MacBook Pro with Retina display, iOS 10.3.3

Posted on

Question marked as Solved

Posted on

Page content loaded

Mar 18, 2018 7:04 AM in response to Kesate In response to Kesate

To recover from what you did read below.

Changing the admin user name requires a specific procedure. For future reference please refer to Change the name of your macOS user account and home folder - Apple Support.

Read the lengthy procedure that follows. You should probably print it vs. writing down the steps or trying to repeat it from memory. Don't be put off by the length of the instructions. Some of the steps are optional. It's simple and will only take a few moments.

It is also overly conservative, but I have used it myself recently and I know it will work.

As I understand it, you have a Mac with no Administrator accounts. Of course that is not supposed to be possible, but if that really is the case you can use the following technique to create a new, temporary Administrator account, the sole purpose of which will be to log in as an Administrator that can give your normal account Admin privileges.

There may be other techniques to recover from the "impossible" circumstance in which you find yourself, but the following is one that I have successfully used in the past.

Please read everything that follows before continuing. If you have only the one computer you will need to print this for reference.


  • If you have not done so already, create a reliable backup in the event something unexpected occurs.

    To learn how to use Time Machine please read Use Time Machine to back up or restore your Mac - Apple Support.

  • If you configured an EFI Firmware Password, that will preclude recovery, unless you know that password.

    A Firmware Password precludes starting a Mac in single-user Mode, so you will need to temporarily remove it before continuing.

  • If you encrypted your startup volume with FileVault, its password will also be required to unlock the disk.

    That password may or may not be the same login password you have been accustomed to using.

Confirm each of the above prerequisites before continuing.


  • Power on or restart your Mac.
  • At the chime or grey screen, hold and S on your keyboard (two fingers) to enter single-user mode.
  • At the localhost:/ root# prompt, type

fsck -fy

...and press Return.

This is a simple check for file system integrity and is optional. It may take a few minutes to complete during which time various messages will appear. None of them are relevant unless they indicate some unrecoverable error. Be patient. If you get concerned that the system has stalled or become unresponsive press the Return key. Nothing will happen other than to echo the Return character, advancing the text on the screen, confirming your Mac has not completely frozen.

When the integrity check completes pressing the Return key will result in the localhost prompt again, waiting for your input.

At the localhost:/ root# prompt, type each of the following lines, exactly as written, including capitalization, one line at a time, each line followed by the Return key. There is a single space preceding the first "slash" ( / ) character in each line:

mount -uw /

rm /var/db/.AppleSetupDone


The Mac will restart, and then take you through the entire setup and registration process that you have not seen since you originally unboxed it. Do not be concerned—none of the above deletes any information. All your pre-existing user accounts will still available, assuming they were intact prior to beginning this procedure.

Do not elect to transfer your information from another Mac: When the "Transfer Information to This Mac" screen appears, select "Do not transfer any information now" and press Continue.

At the "Create a Computer Account" screen, create the new, temporary account using a different "Full name" and "Account name" than the one you already use. Remember the password you select. Provide a password hint if you wish. You don't have to sign in to iCloud or anything else you might decide to do if you wanted to use that User Account for anything else.

"Allow this Account to unlock the disk" will be selected by default, so confirm that it is because that's the key to fixing the problem.

When it completes, log in under that new account. Use System Preferences to change your normal account to "Allow user to administer this computer". Log out, log in under your normal account and verify you can use it without restriction.

After that, you can safely delete the temporary account you just created by following these instructions: Delete a user or group - Apple Support. Before removing it, confirm you don't need any of the files you might have created in that Account.

Mar 18, 2018 7:04 AM

Reply Helpful

Mar 18, 2018 7:26 AM in response to Kesate In response to Kesate

The other posts should get to back working. However, why are you trying to change the account name?

If it is because you got the Mac used from someone else, you should follow the steps in this article in order to eliminate the previous owner and get the OS installed licensed to you instead of the old owner.

What to do before you sell or give away your Mac - Apple Support

If it is just because you don't like the name you originally chose, then you can try to fix it when you create the new account by following the other advice given here.

If you don't need the old Admin account, you don't need to use it. Just use the new account you create when you follow the steps in the links provided by others in this thread. You can then just delete the old admin account.

On a Mac, there is nothing special about the first account created, except that it is authorized to elevate its privileges. You can set that for any account in macOS.

Mar 18, 2018 7:26 AM

Reply Helpful

Mar 18, 2018 7:48 AM in response to Barney-15E In response to Barney-15E

Thanks...the other posts did help in resolving, but was wondering if i should hold on to the old account so that i dont lose data. Your note "On a Mac, there is nothing special about the first account created, except that it is authorized to elevate its privileges. You can set that for any account in macOS." answers my concern.

Mar 18, 2018 7:48 AM

Reply Helpful

Mar 18, 2018 3:14 PM in response to Kesate In response to Kesate

If you have data there that you need, you shoul keep the account folder available until you extract what you need. You can give your new user r/w access to the old account to copy files from old to new. If you need help with that, let us know.

Mar 18, 2018 3:14 PM

Reply Helpful
User profile for user: Kesate

Question: i deleted my administrator account and now i cant login to make any changes