How to Change a User’s Password on Ubuntu: A Step-by-Step Guide
Learn how to change your own password or reset another user's password on Ubuntu using simple terminal commands. This guide covers both user-level and administrative password management.
Managing user passwords is an essential skill for any Ubuntu user or system administrator. Whether you need to update your own password or reset another user's credentials, Ubuntu provides simple command-line tools to accomplish this.
In this guide, we’ll walk through the steps to change passwords securely.
1. Changing Your Own Password
If you want to update your own password, follow these steps:
Open a terminal (you can use **Ctrl + Alt + T** to open it quickly).
Type the following command and press **Enter**:
passwd
The system will prompt you to enter your current password for verification.
After that, you'll be asked to enter a new password. Type it carefully (it won’t be displayed for security reasons).
Re-enter the new password when prompted.
If both entries match, your password will be updated successfully.
2. Changing Another User’s Password (Administrator Access Required)
If you have administrator privileges and need to change another user's password, follow these steps:
Open a terminal.
Use the following command, replacing **username** with the actual username:
sudo passwd username
You will be prompted to enter your own password (for authentication).
Next, the system will ask for a new password for the specified user.
Confirm the new password by typing it again.
Once done, the user's password will be changed immediately.
3. Forcing a User to Change Password on Next Login
If you want a user to reset their password upon their next login, use:
sudo passwd --expire username
This forces the user to set a new password the next time they log in.
4. Unlocking a Locked User Account
If a user account has been locked due to multiple failed login attempts, you can unlock it with:
sudo passwd -u username
5. Additional Security Tips
Choose a strong password with a mix of uppercase, lowercase, numbers, and special characters.
Regularly update your password to enhance security.
Use a password manager to store complex passwords securely.
With these simple steps, you can efficiently manage passwords on Ubuntu, ensuring system security and smooth user access.