Skip to content

Linux passwd Guide

Mattscreative edited this page Dec 5, 2025 · 2 revisions

Linux passwd Guide

Complete beginner-friendly guide to passwd on Linux, covering Arch Linux, CachyOS, and other distributions including changing passwords, password policies, and user password management.


Table of Contents

  1. Understanding passwd
  2. Changing Passwords
  3. Password Policies
  4. User Password Management
  5. Troubleshooting

Understanding passwd

What is passwd?

passwd changes user passwords.

Uses:

  • Change password: Update your password
  • Set password: Set password for user
  • Lock account: Disable account
  • Password policies: Enforce policies

Why it matters:

  • Security: Strong passwords protect system
  • Account management: Control user access
  • Compliance: Meet security requirements

Changing Passwords

Change Your Password

Basic usage:

# Change your password
passwd

# Enter current password
# Enter new password
# Confirm new password

Change User Password

As root:

# Change user password
sudo passwd username

# Or as root
passwd username

# Enter new password

Password Policies

Password Requirements

Common requirements:

  • Minimum length: Usually 8+ characters
  • Complexity: Mix of letters, numbers, symbols
  • History: Can't reuse recent passwords
  • Expiration: Password expires after time

Check Password Age

View password info:

# Check password age
chage -l username

# Or
passwd -S username

User Password Management

Lock Account

Disable account:

# Lock account
sudo passwd -l username

# Unlock account
sudo passwd -u username

Expire Password

Force password change:

# Expire password
sudo passwd -e username

# User must change on next login

Troubleshooting

Password Not Working

Reset password:

# As root
sudo passwd username

# Or boot from live USB
# Mount system
# chroot
# passwd username

Password Policy Errors

Check policies:

# Check PAM config
cat /etc/pam.d/passwd

# Check password requirements
passwd -S username

Summary

This guide covered passwd usage, password management, and policies for Arch Linux, CachyOS, and other distributions.


Next Steps


This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.

Clone this wiki locally