Quick, practical guide to changing and managing Linux passwords with the `passwd` command. 20.04.2026 | reading time: 2 min When a user must update his password or an admin must reset one, `passwd` is the command to run; it changes passwords, locks and unlocks accounts, and can force a password change at next login, offering immediate control from the shell. Real console example Hands-on: change your own password and reset another user's password as an admin. ``` $ passwd Changing password for john. (current) UNIX password: Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully $ sudo passwd alice Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully ``` Locking, expiring and status Take action: use `passwd -l username` to lock an account, `passwd -u username` to unlock, `passwd -d username` to delete a password, `passwd -e username` to expire it so the user must change it at next login, and `passwd -S username` to view the account status. Behind the scenes `passwd` integrates with PAM and the shadow suite: modern systems store hashed passwords in `/etc/shadow` with salts and strong algorithms such as SHA-512, while PAM modules enforce complexity, history and expiry rules; check PAM and shadow settings before sweeping changes. Scripts and automation Tell the system to change many passwords safely: use `chpasswd` for bulk updates with input like `user:password`, or `usermod` for account tweaks, and always run those tools under `sudo` or from a privileged script while securing input to avoid plaintext exposure. Final step Mastering `passwd` is a small but essential step — to deepen skills and earn credentials consider pursuing CompTIA Linux+ or LPIC-1 and prepare intensively with bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. security utilities setup scripting