Linux for Developers Course
Linux for Developers
/
Beginner

passwd

Definition

The command used to change a user's password. It updates the encrypted hashes stored in the `/etc/shadow` file.

Explain Like I'm New

The password reset button.

Real World Example

Bob wants to change his password. He types `passwd`. It asks for his old password, then asks him to type his new password twice.

Common Use Cases

  • •Security hygiene
  • •Initial account setup

Interview Questions

basic

  • If you are logged in as the `root` administrator, do you need to know Bob's current password to change it for him?

intermediate

  • Why does the terminal not show any stars (***) or characters when you type your password?

Flash Cards

Question

Need old password?

Click to reveal answer
Answer

No. The root user can change any password using `sudo passwd bob` without knowing the old one.

Question

Why no stars?

Click to reveal answer
Answer

For absolute security. It prevents someone looking over your shoulder from knowing how many characters long your password is.