0

I have lost administrator access after trying to change my username in system preferences and restarting.

I have followed the directions by rebooting in Single user mode, S and typing the following commands:

/sbin/fsck -fy    

/sbin/mount -uw /  

rm /var/db/.applesetupdone

It then asks if I want to override rm /var/db/.applesetupdone and if I then type "YES" it says that it is a read only file and nothing happens.

I have also tried typing rm /var/db/.applesetupdone in terminal and again it asks me if I want to override, and again answering YES I get the reply Permission denied:

override r--------  root/wheel for /var/db/.applesetupdone? YES

rm: /var/db/.applesetupdone: Permission denied

I am using MacOS High Sierra Version 10.13.4

How do I remove applesetupdone or get administrator privileges back?

1

You can run the command as superuser (explanation on wikipedia)

Either run

sudo rm /var/db/.applesetupdone

or

su

to log in as super user and then regularly run the commands.

1
  • downvotes without commenting what the issue is are barely helpful – Kevin Grabher Apr 5 '18 at 15:40
0

You may have to boot the system in recovery mode

  1. Command+ R. Release the keys when the Apple logo and a progress bar appear.
  2. select Disk Utility and continue.
  3. Select your startup disk in the pane to the left
  4. If its not mounted (greyed ) then mount using mount button username and enter your password, if requested .
  5. Quit Disk Utility.
  6. macOS utility window will appear.
  7. Go to top menu bar (Apple logo)
  8. Click on Utilities.
  9. Start Terminal from the drop-down menu (if not starts click again ).
  10. Enter the following command,
  11. Substitute "startup disk" with the actual name of your startup disk.
  12. rm '/Volumes/Macintosh HD/var/db/.AppleSetupDone'
  13. ls -a Volumes/Macintosh HD/var/db/ to see if the -AppleSetupDone exists
  14. Restart your Mac and it will launch Setup Assistant.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .