To check the account expiration date for a user in Linux, you can use the chage command. Here’s how to do it:
-
Open a terminal.
-
Run the following command, replacing
usernamewith the actual username you want to check:sudo chage -l username
This command will display detailed information about the user's account, including:
- Last password change
- Password expiration
- Password inactive
- Account expiration
The output will include a line that specifies the "Account expires" date, which indicates when the account will be disabled if an expiration date has been set. If it shows "never," it means the account does not have an expiration date.
