The chage command
The chage command modifies date policies for a user's passwords. It has the following syntax:
chage [options] user-name
The following paragraphs describe the options you can use:
- -m days: Specifies the minimum number of days allowed between password changes.
- -M days: Specifies the maximum number of days allowed between password changes.
- -d date: The date of the last password change.
- -E date: The date on which the account will expire.
- -W days: The number of days prior to the password expiring that the user will be warned the password is about to expire.
- -I days: The number of days of inactivity after the password has expired that the account is locked out. Specify 0 to disable this feature.
Here's an example that sets an account to expire on Halloween 2016:
$ chage -E 2016-10-31 ghost
TipIf you specify a username but no other options, you're prompted to enter each option. This is a lot easier than trying to remember all the switches!
In this tutorial:
- Linux Commands
- Command Shell Basics
- Editing commands
- Wildcards
- Redirection and piping
- Environment variables
- Shell scripts
- Directory and File Handling Commands
- The cd command
- The mkdir command
- The rmdir command
- The ls command
- The cp command
- The rm command
- The mv command
- The touch command
- The cat command
- Commands for Working with Packages and Services
- The rpm command
- Commands for Administering Users
- The usermod command
- The chage command
- The passwd command
- The newusers command
- The groupadd command
- The groupdel command
- Commands for Managing Ownership and Permissions
- The chgrp command
- The chmod command
- Networking Commands
- The ipconfig command
- The netstat command
- The ping command
- The route command
- The traceroute command