7

I got a new computer today. I my parents logged in with a username I didn't want so I made another admin. Now, I'm trying to delete the old account.

when I go to Users & Groups in System preferences, click on the old account, hit the - sign to delete it and enter the password, the popup shakes like the password didn't work. I'm sure the password is correct because I used it multiple times to log into the account. I tried switching the old account to admin but that didn't work.

I typed in the password but it didn't work

matt
  • 184
  • 1
  • 7
Dermot McMillan
  • 71
  • 1
  • 1
  • 3

6 Answers6

7

If you can't delete the user for some reason, you can remove it at the command line.

Launch "Terminal" (from /Applications/Utilities/Terminal.app, or search via Spotlight) and type:

sudo dscl . list /Users

...followed by your administrator password. Then hit enter

The output will show you the shortname of your local users (towards the bottom). Here I called the user to be removed "testy" (I'm only showing the last few entries):

...
admin
daemon
Guest
nobody
root
testy

Now remove the user from your system and from System Preferences (exchanging the shortname "testy" with your own, found earlier):

sudo dscl . delete /Users/testy

Then hit enter.

The home folder of that user you can either keep, if there are important files, or delete it with...

sudo rm -r /Users/testy 

...and again hit enter.

PS. A speculative answer for the permissions error received and mentioned in the comments section can be found at StackExchange: What causes eDSPermissionError when running dscl?

Redarm
  • 5,418
  • 3
    It gave me this error:
    delete status: eDSPermissionError <dscl_cmd> DS Error: -14120 (eDSPermissionError) Dermots-MacBook-Pro:~ "my new account's username"$
    – Dermot McMillan Dec 26 '18 at 15:37
  • I'm sure used the name for the old account where you put testy. I tried It a few times and I got the same error. – Dermot McMillan Dec 26 '18 at 15:39
  • It looks to me like an issue with the cryptouser, where I'm most likely in over my head. Does dscl . -list /Users GeneratedUID list the same UID as diskutil apfs listcryptousers disk1s1 (where disk1s1 should be your boot volume on the synthesized disk, as shown in the output of diskutil list)? A search finds a workaround that seems somewhat long-winded and I'm not confident that the problem has been understood properly: https://medium.com/@ambroselittle/cant-delete-original-admin-user-on-macos-high-sierra-1d79fb438246 – Redarm Dec 26 '18 at 16:36
  • The UID generated from the second command shows up next to my old account's username in the first command. It is exactly the same. – Dermot McMillan Dec 26 '18 at 17:13
  • And how many cryptousers were found (excluding any starting FFFFEEEE...)? – Redarm Dec 26 '18 at 17:21
  • There were 2 not starting with FFFFEEEE – Dermot McMillan Dec 26 '18 at 17:32
  • The other one was under my new account – Dermot McMillan Dec 26 '18 at 17:32
  • Sorry about the 1000 questions, but I haven't come across this issue before. So far I've asked all the wrong questions, but one more: if you mount the "Preboot" volume as found via diskutil list, e.g. diskutil mount disk1s2 and check "AdminUserRecoveryInfo.plist" with cat /Volumes/Preboot/$(diskutil info /dev/disk1s1 | awk '/Volume UUID/ { print $3; }')/var/db/AdminUserRecoveryInfo.plist, are the user and the GeneratedUID in the plist the old or the new user? – Redarm Dec 26 '18 at 17:52
  • under <key>GeneratedUID</key>, it dispays the UID for my new account – Dermot McMillan Dec 26 '18 at 18:04
  • Ok, sorry for sending you down the garden path. All I can suggest is either trying the workaround in my first comment (Directory Utility can be launched from the Spotlight menu), or wait for a better answer. – Redarm Dec 26 '18 at 18:10
  • If that doesn't work, I may have found another, embarrassingly ugly way (delete the user from /private/var/db/dslocal/nodes/Default/users/, then manually recreate the user with the same GeneratedUUID as the deleted one in Directory Utility and again delete it {which removes the stranded cryptouser}). – Redarm Dec 27 '18 at 20:12
1

The bold text is a misnomer and likely a bug, see the smaller text underneath. The prompt requires an administrator username and password, i.e. your credentials not that of the account you’re trying to delete.

grg
  • 201,078
  • The User Name box displays my old account's username. The text is grey and won't let me change the name to my current account. I tried using the password for both accounts again and it didn't work. – Dermot McMillan Dec 25 '18 at 20:35
  • @Dermot Interesting, what’s the Mojave version? I tried with a new test account on Mojave 10.14.2 and it requires my administrator password, how odd. Perhaps an iCloud link is the difference, pure speculation but maybe this is something to do with the account having logged into iCloud which my test account was not? – grg Dec 25 '18 at 20:43
  • It's Mojave 10.14.2. It's a brand new computer. – Dermot McMillan Dec 25 '18 at 20:44
  • Is there anything else I can try to delete the account – Dermot McMillan Dec 25 '18 at 21:01
  • I still have not been able to fix the issue, do you have any more suggestions. – Dermot McMillan Dec 26 '18 at 02:16
1

I had this problem and fixed it.

  1. From the Users & Groups panel, right click the user in the list to get Advanced Options...
  2. I Removed the Apple ID and changed the account name (I don't know which did the trick.)
  3. Click OK and restart
  4. Go back to Users & Groups and delete the account with the minus sign box, as usual
0

I had this same issue with Mojave and all i did to FIX it was...

  1. Login to the users account that i was trying to delete
  2. Change the pass to something else and log out again.
  3. Go back into the admin account
  4. Remove the account using the new password.
0

For anyone still struggling, here is what solved it for me:

  1. Logged in as a Standard User, ALICE, and gave ALICE Admin privileges (now 2 admins)
  2. Enabled Secure Token for the other Admin Account, BOB with

sysadminctl -adminUser ALICE -adminPassword ALICEPASSWORD -secureTokenOn BOB -password BOBPASSWORD

  1. Logged back in as BOB and was now able to delete ALICE in Users&Groups

The issue seemed to be with the fact that at least one account must have the Secure Token enabled

P.S. sysadminctl interactive -secureTokenStatus ACCOUNT to double-check if Secure token is enabled

nohillside
  • 100,768
0

In my case, I forgot to log out from the AppleID in the account I wish to delete. That causes 'invalid password' from UI and 'eDSPermissionError' from terminal.
Hope it helps.
macOS Monterey (12.2 and 12.3)

agarza
  • 2,274
MaxXx1313
  • 101