How to Change Your Password in Ubuntu

The Cryptographic Rotation Vector

In a secure Linux environment, user passwords are not stored as plain text files; they are mathematically scrambled using advanced hashing algorithms and stored deep within the protected `/etc/shadow` file. If you suspect your password has been compromised, or if you simply need to enforce a mandatory 90-day security rotation, you cannot edit a settings file manually. You must invoke the dedicated cryptographic utility designed to securely generate a new hash and inject it into the system architecture.

How to Change Your Password

The Ubuntu operating system utilizes the highly secure `passwd` command-line utility to handle all local authentication modifications.

1. Open your terminal application or connect to the server via SSH.
2. To Change Your Own Password: If you are simply updating the password for the account you are currently logged into, type the following command:

passwd

3. Press Enter.
4. The Verification Challenge: The system will immediately prompt you for your `(current) UNIX password`. Type your old password blindly (no characters or asterisks will appear on screen for security reasons) and press Enter.
5. The New Configuration: The system will prompt you to `Enter new UNIX password`. Type your highly secure, complex new password blindly and press Enter.
6. It will ask you to `Retype new UNIX password` to verify against typos. Type it again and press Enter.
7. Administrative Override (To change another user’s password): If you are the system administrator and need to reset the password for an employee named “johndoe”, you must use `sudo` privileges to bypass the requirement for the current password:

sudo passwd johndoe

Press Enter. You will only be asked to provide and confirm the new password. The change is instant, and the new hash is immediately written to the shadow file.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.