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.
- Open Terminal App,
- Now type the command: security set-keychain-password
- Enter the old password.
- Enter new password.
- Re-Enter new password.

% 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!
More Posts related to MacOS,
- Opening mac Terminal
- How to change default macOS Terminal Window size
- How to clear Mac Terminal screen
- Find Hostname of Mac running on macOS Ventura 13
- Installing MongoDB on Linux/Unix/macOS/Ubuntu
- How to switch from bash to zsh shell in macOS Terminal
- Limit scrollback rows in macOS Terminal
- How to Set Background Wallpaper on macOS 13 Ventura
- This operation couldnt be completed. Unable to locate a Java Runtime. [macOS]
- Encode or Decode Base64 String using Mac Terminal Command
- List of All Apple Silicon ARM Based M1/M2 Mac [updated Oct 2022)
- How to remove Siri from Menu Bar [macOS Big Sur]
- Must Know Homebrew Commands for Mac/Linux Users
- Hide Keyboard Text Input Icon on macOS Ventura Menu Bar
- 13.0 MacOS Ventura release date
- How to change the default location of Mac Screenshot
- How to set Out Of Office (OOO) on Outlook for Mac
- 30+ Zoom video communications application shortcuts for macOS
- How to install wget on macOS
- Mac turn dark mode on or off using terminal command
- Create Symbolic Link using Terminal Command
- Mac - How to Install VirtualBox
- How to Enable or Disable Dark Mode on macOS Ventura 13
- How to install homebrew (brew) on M1 Mac
- How to uninstall Microsoft Outlook on Mac
More Posts:
- [fix] Spring Boot Data JPA - No identifier specified for entity - Java
- How to change Android Titlebar theme color from Purple - Android
- Take Screenshots on Mac OS without Keyboard - Mac-OS-X
- How to ls command to output one entry per line [macOS/Linux/Bash] - Linux
- Java 8 Display time in 12 hour AM PM format - Java
- Git Remove Untracked Files using Command - Git
- Step-by-Step: How to install Flutter in Android Studio - Android-Studio
- [Android Studio] Button on click example - Android-Studio