MacOS – Renaming user failed, lost admin rights

high sierramacos

I wanted to change the name of my user as well as its home directory. Looking for a way to do this, I stumbled upon this support document.

I did everything as described there, but since I restarted the computer, all that happened is, that I'm not an admin anymore.

I can't unlock anything under System Preferences > Users & Groups, as well as I'm unable to edit /etc/sudoers/

What went wrong?
whoami still shows my previous username..

How can I fix this mess? Am I screwed now?

macOS 10.13.4 btw

Best Answer

From I don't have administrator account on my mac

  1. Boot into Single User Mode: Start/restart your Mac. As soon as you hear the startup tone, press and hold + S until you see a black screen with white lettering. (If you end up back on the login screen after a flash of the black screen with white lettering, enter your password and it will return to the black screen.)

  2. Mount the drive by typing /sbin/mount -uw / then ↩ enter.

  3. Remove the Apple Setup Done file by typing rm /var/db/.AppleSetupDone then ↩ enter.

  4. Reboot by typing reboot then ↩ enter.

  5. Complete the setup process, creating a new admin account.

This should allow you to create a new admin user.

I will edit this answer to include a fix for your old user soon.