How to reset Mac Password using Terminal


Caution: Make sure to keep a note of the password that you changed before locking/shutting your Mac.

The first thing you need to be is an administrator to reset the password of your Mac.

The steps are very easy,


Step 1: dscl Command

    Open the Terminal app on your Mac and type the below command.

    dscl . -passwd /Users/userName new-password

    Example:
    dscl . -passwd /Users/c2c dj%3dg5C

    Note, you will see a message "Permission denied. Please enter the user's old password:" Once you enter your old password correctly, the password of the user will be changed!

    If you provide a small-length password you will see an error and the reset password will fail.

    passwd: DS error: eDSAuthPasswordQualityCheckFailed
    <dscl_cmd> DS Error: -14165 (eDSAuthPasswordQualityCheckFailed)


Step 2: Validate

    If you changed the password of the currently logged-in user, you can lock your Mac/Macbook by clicking on the Apple logo on the Menu and selecting "Lock Screen"

    Now when you will try to log in, the old password will not work!

Reset Mac Password using Terminal Command

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap