Change Current User Password using Mac Terminal Command


If you want to change the password of the current user that you are logged into the Mac using Terminal then you can make use of the security set-keychain-password command.


Steps to Change Current User Password Using Mac Terminal:

  1. Open Terminal App,
  2. Now type the command: security set-keychain-password
  3. Enter the old password.
  4. Enter new password.
  5. Re-Enter new password.
Change Password of the current user Mac using Terminal
% security set-keychain-password
Old Password: 
New Password: 
Retype New Password:


Note: The command sudo passwd <user-name> will not work to change the current user password, you would see this warning.

% sudo passwd code2care
Password:
Changing password for code2care.
Old password:
New password:

################################### WARNING ###################################
# This tool does not update the login keychain password.                      #
# To update it, run `security set-keychain-password` as the user in question, #
# or as root providing a path to such user's login keychain.                  #
###############################################################################

This is not an AI-generated article but is demonstrated by a human on an M1 Mac running macOS Sonoma 14.0.

Please support independent contributors like Code2care by donating a coffee.

Buy me a coffee!

Buy Code2care a Coffee!

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