Change Current User Password using Mac Terminal Command


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

  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.                  #
###############################################################################
-


Have Questions? Post them here!

Topics Coverage:


🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.

Follow Us: GitHub | Facebook | Twitter | Instagram