Not admin anymore after changing username on MacOS High Sierra

-1

I've changed my username and now I'm unable to do admin stuff. No sudo, no system preferences unlock work.

I've managed to:

  1. start in single user mode
  2. open a terminal
  3. chroot into my system

As this is not a Linux I'm not sure where to change stuff... How to fix this ridiculous mistake?

haxpanel

Posted 2017-11-22T12:39:37.067

Reputation: 109

What method did you use to change your username? How many users did you have before? Were you reusing a username? Were you using 'root' or any other protected names? – Christopher Hostage – 2018-03-21T15:01:54.163

As far as I remember, I did it in the system prefs panel. Can't remember, but probably 1 user. Can't remember. Of course not. See my answer below, I did fix it. – haxpanel – 2018-03-21T17:06:11.750

Answers

1

I've found a solution based on this. Few things I did differently:

  • instead of /sbin/mount -uw / use chroot /Volumes/<yours>
  • instead of rm /var/db/.applesetupdone do rm /var/db/.AppleSetupDone

In nutshell:

  1. boot into recovery mode
  2. open terminal
  3. execute chroot /Volumes/<yours>
  4. execute rm /var/db/.AppleSetupDone - after reboot, it'll make MacOS think it is a new setup, so that you'll be redirected to the post-install screen where you can create a new admin user
  5. reboot
  6. follow steps
  7. update your old user with the newly created one

haxpanel

Posted 2017-11-22T12:39:37.067

Reputation: 109