Recovering admin user account on macOS High Sierra
For the most part, you can follow the instructions located at:
https://discussions.apple.com/message/32825345#32825345
This applies when there are no administrator accounts left on a macOS machine.
Actual steps taken:
- Reboot your machine.
- Hold down
Command-R
during the startup process to force the machine to enter recovery mode. - Follow any language prompts to get to the main options screen.
- Select Disk Utility from the options screen.
- Select your main MacOS boot volume, and then press the mount button from the toolbar.
- Enter your FileVault decryption key when prompted to do so.
- Make a note of where the volume has been mounted to. It will probably be something like
/Volumes/macOS
. - Close the Disk Utility application.
- Open the Terminal application (this can be found under one of the drop-down menu options at the top of the screen).
- Remove the following file (which is located inside your mounted FileVault boot volume):
/Volumes/macOS/var/db/.AppleSetupDone
. - Reboot your machine.
- Follow the on-screen prompts to setup your computer again.
- When prompted to do so, you may create a new (temporary) administrator user account.
- Once the setup procedure has completed, you will be logged into your macOS desktop environment as your new temporary administrative user. At this point you can open the System Preferences application, and re-grant your old user administrator permissions.
- Reboot your machine.
- Login as your normal user again.
- Remove the old temporary user.