In the case a regular user can’t remember his/her password, a superuser can reset the password of a regular user right from the terminal. However, what if the superuser (or root user) loses his/her password? To recover the lost password of a superuser (or root user), it is done quite differently. Running git config -global -unset user.password followed by any git command would prompt you to enter username and password. Git config -global -unset user.password git push (will prompt you for the password) git status (will not prompt for password again).
- Type ' resetpassword ' as one word, without the quotes, and press Return. Close the Terminal window, where you will then find the Reset Password tool. A list of all user accounts on your Mac will.
- If you have root access to your server and wish to change/ reset password of a MySQL user, then you can do via following method via terminal access to the server: Login into the server via root users. Type mysql (press enter) to enter into myql command prompt Here we have got MariaDB, since the server has MariaDB.
![Terminal Terminal](https://i.ytimg.com/vi/HKcOcrOLo8A/maxresdefault.jpg)
How Do I Change My Computer Password
Update May, 2019
Now that there are SecureToken users, the command below no longer works to reset another user's password. Thanks to mario on the MacAdmins Slack for testing.
Remove Mac Password Terminal
Acknowledgements
Just a cleaned-up version of directions from Mac Script to change Administrator password
Changing a user password via terminal command
If you ever want to—perhaps for scripting purposes?—change a user's password from the command-line (despite what it says in the link above, you don't have to be logged in as the user to change the user's password, but you do have to be logged in as an admin user), these are the commands you'd use:
sudo /usr/bin/dscl . -passwd /Users/usernamenewpassword
sudo security set-keychain-password -o oldpassword -p newpassword /Users/username/Library/Keychains/login.keychain
Substitute in the actual user's username for username, the actual user's old password for oldpassword and the actual user's new password for newpassword.
sudo security set-keychain-password -o oldpassword -p newpassword /Users/username/Library/Keychains/login.keychain
If you don't know the old password..
If, for some reason, you (and the user both) have forgotten the user's old password and don't want to deal with keychains issues, you can also just delete the existing keychain (instead of running the second command to update the keychain password): Iphone menu simulator.
Security issues
One strong Plex osx sierra. caveat is that the terminal, by default, will save commands to ~/.bash_history in plain text, so you're essentially storing a user's password in plain text, unless you temporarily disable bash history or later go into the ~/.bash_history file with a text editor (like nano) and delete the offending lines manually.
Simple 2d drawing tool. If you distribute this as part of a .pkg, nothing will be visible in a .bash_history file, but make sure you keep that .pkg extra secure or delete it after deploying it.