Unofficial archive. This is a read-only, community-run archive of the Apple Support Community. It is not affiliated with or endorsed by Apple Inc.

How to recover lost administrator account on MacBook?

I changed my administrator name the wrong way and now it has changed to standard. MacBook Air 2012 OS High Sierra 10.13.6 I have tried different suggestions from the discussions to try and get to the Setup Assistant but none of them has worked for me. Please advise.


[Re-Titled by Moderator]

Original Title: Lost Administrator account

5 replies

If you have another macOS admin user account on the laptop, then use the following Apple article to correct the mistake with your "broken" admin user account:

Change the name of your macOS user account and home folder - Apple Support



If you don't have another macOS admin user account, then you will need to trick macOS into running Setup Assistant again. This will involve using the command line. These particular instructions will only work on macOS up until about macOS 10.14 Mojave....different instructions are needed for macOS 10.15 to 13.x.....it is impossible to do this with macOS 14.x+.


You can do this by booting into Single User Mode by holding the Command + S keys just after powering on the computer & hearing the startup chime (hold it immediately after the chime...it may not work holding it sooner). Then at the command prompt enter the following commands making sure to press the "Return" key at the end of each line to execute each command:


fsck  -fy
mount  -uw  /
rm  -i  /var/db/.AppleSetupDone
reboot


If all these commands complete without any errors when you reboot the computer Setup Assistant should run where you can create a new admin user account. Once you create the new admin account follow the instructions in the link I provided earlier to fix your original user account. All of the instructions in that Apple article must be followed exactly.


Make sure to always have frequent and regular backups of your computer and all external media (including the cloud).


Edit: Corrected incorrect OS versions mentioned in my post here.

Limnos wrote:

Not that I have tried it but I thought it was impossible to not have at least one administrator status account on a Mac.

If a user attempts to change the short user name incorrectly, then it breaks their admin user account. Here is an Apple article which has instructions for changing the macOS user account name......the instructions must be followed exactly & every step is required (only one optional step).

Change the name of your macOS user account and home folder - Apple Support


So we don't repeat ourselves in trying to assist you with this issue, what exact suggestions have you already tried that didn't work for you? The more you can provide us, the better we can help you.


What exactly do you mean that you changed your Mac's administrator account name the "wrong way"?

Not that I have tried it but I thought it was impossible to not have at least one administrator status account on a Mac.

+1