Unable to delete user in macOS

I ran into this problem and found an old thread that can't be updated, so thought I would post the solution here for those searching in the future...


Problem:

Normal methods can't be used to delete a user account, even when authenticated as an administrator of the machine. When attempting from System Preferences, a prompt asks for the user's password that is being deleted, and even though the correct password is given (verified), it doesn't work, the prompt just "shakes" and stays on screen as if the wrong password was given.


Solution:

This situation was related to having a Secure token enabled on the account to be deleted, which was likely due to FileVault encryption being enabled in the past & some form of APFS restriction, even though FileVault was turned off. To verify if there is a Secure token enabled, run the following command:


dscl . list /Users | grep -v '_' | xargs -I {} sysadminctl -secureTokenStatus {}


The output showed that the account in question did have Secure token ENABLED & that other local accounts did not.


To disable the Secure token:


sysadminctl -secureTokenOff <name of account> -password <password of account> interactive


The interactive switch instructs the utility to prompt for an admin password using a dialog box instead of on the command line, which prevents your admin password from getting saved in bash_history.


A successful operation resulted in "Done!" and then the accoutn was able to be deleted from System Preferences like normal.


Hope this helps someone running into this problem in the future!


Cheers!

Vince

Posted on Aug 5, 2019 6:29 AM

Reply

Similar questions

1 reply

Aug 17, 2019 12:16 PM in response to vatnaz

Thank you Vince, trying to delete a user acc't for two days now, your post was most helpful.

Output shows the only account with secure token is the one I want to delete, which may explain why normal removal method appears to work for any acc't _except_ the one to be deleted.


Still unable to remove token tho, getting errors:

Operation is not permitted without secure token unlock.

NSLocalizedFailureReason=Operation is not supported by the directory node.}


The token thing is all new to me, looking for solution to 'user delete' issue, but now I know what to look for.

Thank you, Vince!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Unable to delete user in macOS

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.