How to Delete a Local User Using Command Line on Mac OS X

One user reported that she could not log on using her regular network account on a particular Mac computer. Her account worked on all other computers but not on this one computer. If we configured the login screen to list users, you could see that a local account by the the same name was listed. However, when we checked the System Preferences and tried to delete the account, the account was not there. We were therefore unable to delete the local user account.

If you’re thinking about purchasing a new GPU, we’d greatly appreciate it if you used our Amazon Associate links. The price you pay will be exactly the same, but Amazon provides us with a small commission for each purchase. It’s a simple way to support our site and helps us keep creating useful content for you. Recommended GPUs: RTX 5090, RTX 5080, and RTX 5070. #ad

This excellent post led me to resolve the problem. To search for a user, use this command.

/usr/bin/dscl . -search /Users name username

You can then use this command to delete the user.

sudo /usr/bin/dscl . -delete "/Users/username"

After I deleted this hidden local user account, my user could log on using her network account again.

Be the first to comment

Leave a Reply