To change a user password in a Unix-like operating system, you can use the passwd command. Here’s how to do it:
For the Current User
- Open a terminal.
- Type the following command and press Enter:
passwd - You will be prompted to enter your current password, followed by the new password twice for confirmation.
For Another User (Requires Superuser Privileges)
- Open a terminal.
- Use the following command, replacing
usernamewith the actual username:sudo passwd username - You will be prompted to enter a new password for the specified user.
Example
To change the password for a user named datauser, you would run:
sudo passwd datauser
Note
- Ensure that the new password meets any complexity requirements set by your system.
- After changing the password, the user may need to log in again to use the new password.
If you need further assistance, feel free to ask!
