Remove stubborn user accounts with Directory Utility

If you have accounts in OS X that the system stubbornly refuses to remove, there are some things you can try.

User accounts in OS X are managed by default through the Accounts system preferences (Users & Groups in Lion), where you can add or remove them, or change properties such as administrator status via a simple interface. However, sometimes if you are trying to delete an account the system may be stubborn and refuse to allow this action, so the account reappears when you next launch the system preferences.

This type of problem generally means the system preferences cannot properly access the system directory, which can happen if corruption or permissions faults occur when you upgrade the operating system software or make other major changes.

If you experience problems when trying to remove accounts on your system, there are several things you can try:

  1. Check permissions
    The first and easiest step is to open Disk Utility and perform a permissions fix on the boot volume: select the boot volume, and click the "repair permissions" button in the First Aid tab. If a permissions fault is making the directory files and folders readable but not allowing edits, then your ability to modify accounts may be affected.

  2. Try creating a new account
    Creating a new account on the affected system may clear problems with the directory, as this will write a new node to the directory and perhaps spur the system to access it properly.

  3. Directory Utility
    In the Directory Editor select Users (1), followed by the Local directory (2), and then authenticate (3). Then select the desired account (4) and click the minus button to delete it (5). Screenshot by Topher Kessler
  4. Use an alternate directory management tool
    A last option is to bypass the system preferences when trying to delete a user account, and instead use the Directory Utility tool that Apple provides with OS X, which may be better equipped than the system preferences for managing the directory in some situations.

    The Directory Utility is located in the /Macintosh HD/System/Library/CoreServices/ folder, so launch it and then follow this procedure to clear stubborn accounts:

    First select the Directory Editor in the utility's toolbar, and then ensure you are viewing the Users in the node "/Local/Default," which will list all of the local users on the system. Then click the little lock icon and authenticate as an administrator. After doing this, you will see a number of users listed, but most of these are system accounts that are used for various services like file sharing, audio management, and authentication management.

    In this list you should be able to find the name of the user account you would like to delete. Select it, and then click the minus button to delete it. Confirm that you want to remove the account, and then go to the /Macintosh HD/Users/ directory on the hard drive and remove the user's home folder to finish the deletion process.


Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.

Tags:
Computers
About the author

    Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.

     

    Join the discussion

    Conversation powered by Livefyre

    Don't Miss
    Hot Products
    Trending on CNET

    HOT ON CNET

    Is your phone battery always at 4 percent?

    These battery packs will give your device the extra juice to power through all of those texts and phone calls.