Linux passwd Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
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
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
- User and Groups - User management
- PAM Guide - Authentication
- Security Configuration - Security
- passwd Documentation:
man passwd
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.