Progress: 0/62 (0%)

🔑 Managing Passwords

Managing Passwords

Think of passwords as the keys to an employee's office desk. If someone loses their key or wants a new one, the office admin can change it.

4a. passwd

The passwd command lets you set or change a user's password.

passwd

If you're changing your own password:

The system will ask:

  • Current password → a
  • New password → b
  • Confirm new password → c

Analogy: You're at the security desk, swapping your old key for a new one.

sudo passwd john

To change another user's password (requires root/sudo):
You don't need John's current password; you just set a new one.

4b. Password Policies

Just like the office may have rules for strong keys, Linux can enforce strong passwords.

Examples of common rules:

  • Minimum length (e.g., 8 characters) → o
  • Mix of letters, numbers, symbols → o
  • Expiration (need to change every X days) → o
chage -l john

To check when a password expires:

Analogy: Security checks when the employee's key needs replacement.

Real-life analogy

✅ Key takeaway:
1. passwd = change your or another user's password
2. Strong passwords = stronger "office security"
3. Admins can enforce expiration and policies