Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I installed server and fiddling around settings and I unchecked administer this account and the server crashed immediately.

Now I am listed as standard user and cannot perform any changes:

$ dscl . -read /groups/admin GroupMembership
GroupMembership: root

I thought there will be atleast 1 user to administer the whole computer excluding root :(. How can I get back. Quite panicked as I might loose everything.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

You can try whether sudo -s still works (which would allow you to add yourself to the admin group again), but probably it won't.

Do the following

  • Reboot into Single User mode by keeping Cmd-S pressed during reboot
  • /sbin/mount -uw /
  • rm /var/db/.AppleSetupDone
  • reboot

This will trick your Mac into behaving like a new installation (but with your data still intact). Follow the setup without migrating any data etc., near the end you will have the option to create a new user with admin privileges. Make sure to pick a new username here to avoid any conflicts.

share|improve this answer
    
Why not Single User Mode in first place? –  Max Ried Aug 1 '12 at 10:17
1  
That will probably work as well. The idea is not to recover the system afterwards but just to create a new admin user. –  patrix Aug 1 '12 at 10:18
    
sudo -s says this : Gamer is not in the sudoers file. This incident will be reported. –  Gamer Aug 1 '12 at 10:19
    
I will try CMD-R now what should I do once I enter recovery mode? –  Gamer Aug 1 '12 at 10:19
    
So once I enter recover mode I create a new admin account correct? –  Gamer Aug 1 '12 at 10:20
show 19 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.