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