I don’t think that is the reason. Can you please describe what happens when you try to delete the user?
Every standard or admin user should be a member of the staff group.
In addition to the question asked above, please also elaborate on how the user was created.
sudo sysadminctl -deleteUser <user name>
sudo sysadminctl -deleteUser <user name> -keepHome
sudo sysadminctl -deleteUser <user name> -secure
To delete a user from Terminal
Code:sudo sysadminctl -deleteUser <user name>
Instead of <user name>, put the name of the user you want to delete.
Yes, without <>. And yes, it asks for you password, assuming your account has admin rights.
Sorry, I must have replied while you were editing the post.Yes I did. See post above, what I got back from Terminal, it says:
“User todel can not be deleted (it's either last admin user or last secure token user neither of which can be deleted)”
Any ideas how to fix?
sudo sysadminctl -secureTokenOff todel
Do you have another admin user?
What are the outputs of this command when you use it with the username of your user and the username of the user you want to delete?
sysadminctl -secureTokenStatus <username>
All in all, this sounds to me as if the user you are trying to delete the other user from is not an admin user. There must be at least one admin user on your Mac.
Sorry, I must have replied while you were editing the post.
First, make sure that your account has admin rights.
https://support.apple.com/guide/mac-help/set-up-other-users-on-your-mac-mtusr001/mac
You can turn off the secure token with
Code:sudo sysadminctl -secureTokenOff todel
My user (Admin): 2022-03-19 22:42:27.221 sysadminctl[5358:89594] Secure token is DISABLED for user John
User - that I want to delete: 2022-03-19 22:43:56.090 sysadminctl[5402:90483] Secure token is ENABLED for user todel
2022-03-19 22:45:36.119 sysadminctl[5458:91579] Operation is not permitted without secure token unlock.
Secure token is used for FileVault. Have you enabled FileVault? Can you check System Preferences → Security & Privacy → FileVault to see if there is a warning there?
Which Mac model do you have? Did you reinstall macOS at some point?
Under any circumstances do not delete this account, macOS is stopping for good reasons. It may be the only admin with a secure token. Secure token is used to authenticate users to be FileVault and volume owners. Deleting this user may make you mac non-bootable (can't generate FileVault user that is used to unlock the encrypted disk drive) and system updates will fail (no volume owners).Terminal Results for..
My user (Admin): 2022-03-19 22:42:27.221 sysadminctl[5358:89594] Secure token is DISABLED for user John
User - that I want to delete: 2022-03-19 22:43:56.090 sysadminctl[5402:90483] Secure token is ENABLED for user todel
It seems you have to enable secure token for your user, John, in order to disable and delete the user todel.
Under any circumstances do not delete this account, macOS is stopping for good reasons. It may be the only admin with a secure token. Secure token is used to authenticate users to be FileVault and volume owners. Deleting this user may make you mac non-bootable (can't generate FileVault user that is used to unlock the encrypted disk drive) and system updates will fail (no volume owners).
Generate a new admin user, you may be prompted to enter the password for todel as they have a secure token, log out of the account you are in, log into that new admin user. On login the new user will be given a new secure token. You can then delete user todel.
Was there no warning in System Preferences? It should give you a clue there if FileVault is not configured for all users.Yes, it's on
I have a MacBook Pro (15-inch, 2017)
I installed Mac OS Monterey today. But that extraneous user I've had around for a while and just thought it was time to delete it.
sudo fdesetup list -extended
sysadminctl -secureTokenOn <username> -password - interactive
(note the whitespace between the dash and “interactive”)sudo fdesetup add -usertoadd <username>