board logo
Lemonde
  • Lemonde
  • 100% (Exalted)
  • Advanced Member Topic Starter
7 months ago
This Mac keeps telling me the password to remove the user is wrong even though I have changed it and tested logging in with it.
Sponsor

Want to thank us? Use: Patreon or PayPal or Bitcoins: bc1q4whppe29dw77rm4kv4pln0gqae4yjnxly0dny0hky6yhnafukzjsyrsqhk

All opinions expressed within these pages are sent in by members of the public or by our staff in their spare time, and as such do not represent any opinion held by sircles.net Ltd or their partners.

sirclesadmin
7 months ago

That is a very frustrating and common issue in macOS, especially in older versions like Mojave, where the system seems to reject a password it should accept.


The password prompt when deleting a user in System Preferences > Users & Groups is usually asking for the password of the Administrator account you are currently logged into, not the password of the user you are trying to delete.


If you are certain you are using your own (the admin) password and it's still being rejected, there are two primary methods to resolve this: a simpler troubleshooting step, and a more advanced Terminal command.




1. The Simple Fix: Log Out and Reboot


A temporary glitch can cause the password to be rejected. Try these steps first:



  1. Log Out of the User to be Deleted: Make absolutely sure the user account you are trying to delete is logged out.

    • Go to the Apple menu () in the top-left corner.

    • Look for a menu item that says Log Out [User Name]... (If it's there, click it and confirm).



  2. Restart your Mac. This can clear any cached credentials or temporary issues.

  3. Log in to your Administrator account (the one that is not being deleted).

  4. Go to System Preferences > Users & Groups, click the padlock to unlock, and try to delete the other user again, using your Administrator password.




2. The Advanced Fix: Delete via Terminal (Recommended Alternative)


If the password is still rejected, you can bypass the graphical interface bug by using the command line with Directory Services (dscl). You must be logged in as an administrator to do this.


** Important:** This is a powerful command that instantly deletes the user's account record. Be extremely careful with spelling and spaces.


Step A: Find the User's "Short Name"



  1. Open Terminal (located in /Applications/Utilities/).

  2. Type the following command to list all user short names, then press Enter:
    sudo dscl . list /Users 


  3. Enter your Administrator password when prompted (you won't see anything as you type).

  4. Find the short name of the account you want to delete (e.g., testuser, johnny). Write it down exactly.


Step B: Delete the User's Account Record



  1. Use the following command, replacing [short_name] with the exact short name you found in Step A (e.g., sudo dscl . -delete /Users/testuser):
    sudo dscl . -delete /Users/[short_name] 


  2. Press Enter. If successful, the Terminal will not give you any confirmation message; it will just move to a new prompt line.


Step C: Delete the User's Home Folder (Optional but Recommended)


Deleting the account in the Terminal only removes the user record, not their personal files (the Home Folder). If you no longer need their documents, photos, etc., you can delete the folder:



  1. Use the following command, replacing [short_name] again:
    sudo rm -rf /Users/[short_name] 


  2. Press Enter. The Home Folder will be permanently deleted.


After this, the user should be completely removed from your Mac.


Would you like me to walk you through the Terminal commands step-by-step, or would you prefer to try the simple log-out and reboot first?