How to change account expiration date?

QuestionsQuestions8 SkillsProUser Account ManagementSep, 20 2025
0206

To change the account expiration date for a user in Linux, you can use the chage command. Here’s how to do it:

  1. Open a terminal.

  2. Run the following command, replacing username with the actual username and YYYY-MM-DD with the new expiration date you want to set:

    sudo chage -E YYYY-MM-DD username

For example, to set the account expiration date to December 31, 2025, you would use:

sudo chage -E 2025-12-31 username
  1. To verify that the expiration date has been updated, you can check the account details with:

    sudo chage -l username

This will display the updated expiration date along with other account information. If you want to remove the expiration date and allow the account to never expire, you can set it to never expire with:

sudo chage -E -1 username

This will remove any expiration date for the specified user account.

0 Comments

no data
Be the first to share your comment!