How to Set Password Expiry
The -x
option allows you to set the maximum number of days a password is valid. Example:
passwd -x 30 user3
This sets a maximum password age of 30 days for the user “user3”
How to Change User Password in Linux | passwd Command
Securing user accounts is a fundamental aspect of maintaining a robust and secure Linux system. One essential task is changing user passwords regularly to prevent unauthorized access. The passwd
command in Linux provides a straightforward and effective way to modify user passwords. This article will guide you through the process of changing user passwords using the passwd
command, offering insights into its various options and best practices.
Table of Content
- Understanding the `passwd` Command
- Basic Syntax of `passwd` in Linux
- Options Available in `passwd` Command in Linux
- 1. How to Change User Password in Linux
- 2. How to Change Another User’s Password in Linux
- 3. How to Change the User Password Forcely
- 4. How to Lock and Unlock User Account in Linux
- 5. How to Set Password Expiry
- Processing in passwd command: