If your Mac has no admin account anymore or if your macOS account lost its administrator rights on macOS 10.14 Mojave, macOS 11 Big Sur or later, you can recover the macOS admin rights easily by running again Apple’s Setup Assistant tool to add a new admin account. For getting in the setup process, you have to remove the file “.AppleSetUpDone” via Terminal or macOS Recovery mode. Then, you can recover the admin rights of your original admin account via the new administrator account. After that, you can reboot into your recovered one and delete the interim admin account.
Note: The following fixes apply to macOS Mojave 10.14, macOS Big Sur 11 and later. For macOS High Sierra 10.13 and earlier, fixing Mac no admin account is solved via the “Command – S” (SUM = Single User Mode) route which is deactivate in later macOS versions: How To Recover Lost Admin Rights On macOS High Sierra and Sierra, Mac OS X El Capitan And Yosemite
The following fix “Mac no admin account” works if you lost admin account and admin rights
- during upgrading, e.g. from OS X 10.13 High Sierra to macOS Mojave 10.14 or to macOS Big Sur 11
- after restoring your Mac from backup, or
- after making heavy modifications to the system
The above mentioned situations can result in destroying or downgrading your admin account to a standard user account with no admin rights. In consequence, you cannot log in to your admin account or cannot use it for changing system settings.
Even though the Setup Assistant only runs once when you first install Mac OS X / macOS, it remains on your computer and is prevented from running by the presences of a hidden file called ‘.AppleSetupDone‘ in a system folder on your Mac. Therefore, to go through the Setup Assistant again you can create a fresh admin account, you simply need to remove this file:
Mac no admin account: How to recover admin rights by deleting .AppleSetupDone file via Terminal
- Open Terminal in macOS.
- Change the directory: Type cd /var/db and hit enter tab.
- Run the following command to remove file “.AppleSetupDone”: Type sudo rm -f ./.AppleSetUpdone and hit enter tab.
- Restart your Mac and go through the Setup Process. Create a new account and take a DIFFERENT username than your Standard user account (e.g. “Backup Admin”)
- After logging in, open System Preferences and select your Standard user account and check the box labeled “Allow user to administer this computer” (Note: if the box is grayed out, click the lock icon the lower left to enabled editing)
- Log out of your Mac and log in in as your original account.
- Either delete the Admin account you created in step 4 or, even better, leave it as a backup account.
Mac no admin account: How to recover admin rights by deleting .AppleSetupDone file via macOS Recovery Mode
- Shut down your Mac.
- Reboot your Mac and press and hold “Command + R“.
- At the “macOS Recovery”-Screen select a user, click on “Next” and enter the user’s password. Note: If you do not know the password click on “Forgot all passwords” and sign in with your Apple ID. This step is needed if you secured your Mac with FileVault.
- On the next screen select Disk Utility and mount all internal discs, especially “Macintosh HD – Data“.
- Close Disk Utility and open Terminal via selecting Utilities and then Terminal.
- At the prompt (in my case [-bash-3.2#]) type cd /Volumes/”Macintosh HD”/var/db and hit enter tab.
- Run the following command to remove file “.AppleSetupDone”: Type rm -f ./.AppleSetUpdone and hit enter tab.
- Then reboot your Mac: Type reboot and hit enter tab.
- Your Mac reboots. Go through the Setup Process. Create a new account and take a DIFFERENT username than your Standard user account (e.g. “Backup Admin”)
- After logging in, open System Preferences and select your Standard user account and check the box labeled “Allow user to administer this computer” (Note: if the box is grayed out, click the lock icon the lower left to enabled editing)
- Log out of your Mac and log in in as your original account.
- Either delete the Admin account you created in step 4 or, even better, leave it as a backup account.
Lost access to admin account on macOS 10.14 Mojave or later, can easily restored by reactivating Apple’s Setup Assistant tool through deleting the file “.AppleSetupDone” via terminal or macOS recovery mode. After rebooting your Mac or MacBook you walk through the process to set up a fresh administrator account with full admin rights.
Stay tuned! 😉
64 Comments
thank you sooo much
You’re welcome! Thanks for your feedback!
Hello, does this delete the content in the computer?
Thank You.
Hi Carly,
no, it doesn’t!
Best regards,
Gee Are
Thank you this helped so much ??
Hey there, I got most of the way through this process, but after trying to make the new account, the machine stops at the create-new-account screen; just sticks there with no resolution. I restart and the account is technically created but will not log in, and the recovery mode does not detect the account either.
My use case was downgrading from Monterey, in case you were wondering.
Hi Ernie,
please try the following:
If your Mac restarted because of a problem
How to reset the SMC of your Mac
Reset NVRAM or PRAM on your Mac
How to use safe mode on your Mac
Best regards,
Gee Are
I can’t get to the set up process, gone through the steps using recovery, put each line in Terminal and didn’t say anything each line (put it in wrong a few times and it said doesn’t recognise or something) put reboot but then it just brings me back to the login screen, no setup process?
Mac no admin account instructions worked for me on Mac M1. Thanks!
Yeah worked for me too. No need to mount drives though as they are already mounted after booting into recovery. Also, once in the db directory I just ran rm .AppleSetUpdone
Hi Mary,
which Mac do you have, eventually one with an M1 chip? Which macOS is running on your Mac, Big Sur?
Best regards,
Gee Are
Terminal doesn’t work because there are no admin users. When I enter recovery mode it says there are no admin users and only gives a restart option. Probably a good thing security-wise that this is difficult but what a pain! I will have to contact Apple support.
The instructions for doing this via Terminal don’t work, because sudo requires an admin account — and the lack of an admin account is the whole reason for going through this!
Hi, you need to read the instructions under “Mac no admin account: How to recover admin rights by deleting .AppleSetupDone file via macOS Recovery Mode“!
When I try to enter recovery mode it only lets me restart because “no administer account is associated with this volume.” How else can I do this?
Hi J,
try what Nigel suggested here in his comment.
Best regards,
Gee Are
When we type cd /Volumes/”Macintosh HD”/var/db,it shows no this file?
You have to use instead of „Macintosh HD“ the name of your Macs hard disk name!
what’s the name of HD,we just found the same name as Macintosh HD
Pingback: How To Recover Lost Admin Rights On macOS High Sierra and Sierra, Mac OS X El Capitan And Yosemite - miapple.me