Forrest logo
back to the chage tool

chage:tldr:f2485

chage: Force user to change password on next log in.
$ sudo chage --lastday ${0} ${username}
try on your machine

This command is used to change the expiration date of a user's password. Here's a breakdown of each part:

  • sudo: It is a command that allows a user to run commands with the security privileges of another user, usually the superuser (root).
  • chage: It is a command-line utility used to modify the password expiry information for a user account.
  • --lastday: It is an option used with the chage command to set the last day of password validity.
  • ${0}: It represents the current date or the day when the command is being executed.
  • ${username}: It represents the username for which the password expiration is being changed.

In summary, this command with appropriate values for ${0} and ${username} would change the expiration date of the password for the given username to the current date.

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