macOSHighSierraAdminAccountRecovery

nicolaw 13th April 2018 at 10:01am
Mac macOS Security TechnicalNotes

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:

  1. Reboot your machine.
  2. Hold down Command-R during the startup process to force the machine to enter recovery mode.
  3. Follow any language prompts to get to the main options screen.
  4. Select Disk Utility from the options screen.
  5. Select your main MacOS boot volume, and then press the mount button from the toolbar.
  6. Enter your FileVault decryption key when prompted to do so.
  7. Make a note of where the volume has been mounted to. It will probably be something like /Volumes/macOS.
  8. Close the Disk Utility application.
  9. Open the Terminal application (this can be found under one of the drop-down menu options at the top of the screen).
  10. Remove the following file (which is located inside your mounted FileVault boot volume): /Volumes/macOS/var/db/.AppleSetupDone.
  11. Reboot your machine.
  12. Follow the on-screen prompts to setup your computer again.
  13. When prompted to do so, you may create a new (temporary) administrator user account.
  14. 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.
  15. Reboot your machine.
  16. Login as your normal user again.
  17. Remove the old temporary user.