Hi, this is Sandra Henry-Stocker, author of the “Unix as a Second Language” blog on NetworkWorld.
In this Linux tip, we’re going to look at the chage command. The name stands for “change age” and allows Linux admins to manipulate aging settings for user accounts – when passwords will must be changed or accounts will expire.
To view settings for your account, you can use this command ($USER is your account name):
To view another user’s settings, you would need to use sudo or be logged in as root:
In both cases, we see when the users’ password was last changed. The other settings are very different. Nemo has to change his password every 90 days, but then can’t change his password again for a week.
To change the maximum number of days that a password will be valid, use a command like sudo change -M 90. To set the number of days before a password can be changed again, use a command like sudo chage -m 7 command. The numbers are up to you, but these settings are fairly common.
To set an expiration date for an account, use a command like this:
That’s your Linux tip for the chage command.
If you have questions or would like to suggest a topic, please add a comment below. And don’t forget to subscribe to the IDG Tech(talk) channel on YouTube.
If you liked this video, please hit the like and share buttons. For more Linux tips, be sure to follow us on Facebook, YouTube and NetworkWorld.com.