Forrest logo
back to the chage tool

chage:tldr:96652

chage: Enable password expiration in 10 days.
$ sudo chage --maxdays ${10} ${username}
try on your machine

The command sudo chage --maxdays ${10} ${username} is used to change the maximum number of days between password changes for a specific user.

Here's a breakdown of the command:

  • sudo is a command in Unix-like systems that allows a user with administrative privileges to execute a command as the superuser or another user.
  • chage is a command used to modify the aging and expiration parameters of a user account in Linux.
  • --maxdays specifies the aging parameter to be changed. In this case, it refers to the maximum number of days a user's password can remain unchanged before it must be changed.
  • ${10} is a placeholder for a value. It represents the number of days you want to set as the maximum before a password needs to be changed. You need to replace ${10} with the actual value you desire.
  • ${username} is another placeholder for a value. It represents the username of the user account you want to make changes to. You also need to replace ${username} with the actual username.

By executing this command with appropriate values, you can modify the aging parameters for a specific user account, setting the maximum number of days between password changes as desired.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the chage tool