Skip to content

Instantly share code, notes, and snippets.

@mohanpedala
Last active March 9, 2022 09:14
Show Gist options
  • Save mohanpedala/fc85481b464935af929d82d54a1b24c4 to your computer and use it in GitHub Desktop.
Save mohanpedala/fc85481b464935af929d82d54a1b24c4 to your computer and use it in GitHub Desktop.
Force Delete user in mac

Can’t Delete Original Admin User on macOS High Sierra

I recently migrated to a new MacBook Pro. The old one was on High Sierra, but the new one wasn’t. So I created a temp “admin” account to do the upgrade, then do the migration with Migration Assistant.

All seemed okay, but when I went to delete the original user account, I couldn’t. And I don’t mean “you don’t know how to delete accounts” couldn’t. I mean, I tried every possible way, and it wouldn’t couldn’t.

I found this thread on the Apple forums with people having the same problem. After trying everything else, this is the solution shared in one of the replies that worked. Warning, I have no idea of the side effects this might have, but so far so good for me. Also, do not come crying to me if it totally hoses your machine. You’ve been warned!

  • System Preferences > Login Options > Join… > Open Directory Utility…
  • Click to unlock it. (You may need to Enable Root User in Edit menu.)
  • Go to Directory Editor. Search to find the user you can’t delete — the original user that was logged in when upgrading to High Sierra.
  • Find the GeneratedUID field on the right and copy it somewhere safe.
  • Change one digit in it and Save.
  • Find your new/main user account > GeneratedUID, paste in the one copied above. Save.
  • Identify the BDS device node value by following the below steps.
    • open spot light search (cmd+space) type Disk Utility
    • Mark/Select your startup disk
    • click on the info icon in the top right of the window
    • In the pop-up window find the row 'BDS device node', copy the value and run the below command.
  • Run diskutil apfs updatePreboot <BDS_device_node> in Terminal.
  • Reboot.
  • Login as your main user. You should be able to delete the original user now.
@ben-w-smith
Copy link

@temiyemi I've spent the last 3 days trying to figure this out and your fast user switching comment fixed it for me, thank you!

@007rules
Copy link

007rules commented Mar 9, 2022

Question: Which is the "startup disk," Macintosh HD or Macintosh HD - Data? They have different nodes and I want to be sure to use the right one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment