Linux / Security: User Account Expiration Management
I am a firm believer in regular password rotation/change and Linux has a built in mechanism that makes it easy. The following is a brief overview of password and account ageing for Linux based systems.
The program that enables listing and modification on the expiration parameters is ‘chage’. Each individual user can view their account settings as shown below.
testuser@testServer:~$ chage -l testuser
Last password change : Aug 07, 2009 Password expires : Nov 05, 2009 Password inactive : never Account expires : Aug 05, 1992 Minimum number of days between password change : 90 Maximum number of days between password change : 90 Number of days of warning before password expires : 7
As you can see above, the last password change date is listed, as well as the expiration date for the current password. When executed from a non-privileged account, the user can only view their own account.
testuser@testServer:~$ chage -l root chage: Permission denied.
Also, the non-privileged account can not change their settings either.
testuser@testServer:~$ chage -M 99 testuser chage: Permission denied.
From the root account, you have to ability to modify all the settings for individual users.
root@testServer:~# chage
Usage: chage [options] [LOGIN]
Options:
-d, --lastday LAST_DAY set last password change to LAST_DAY
-E, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
-h, --help display this help message and exit
-I, --inactive INACTIVE set password inactive after expiration
to INACTIVE
-l, --list show account aging information
-m, --mindays MIN_DAYS set minimum number of days before password
change to MIN_DAYS
-M, --maxdays MAX_DAYS set maximim number of days before password
change to MAX_DAYS
-W, --warndays WARN_DAYS set expiration warning days to WARN_DAYS
Before modification, I am going to turn off all expiration settings on the ‘testuser’ account. This is disabling password expiration on that individual account.
root@testServer:~# chage -E -1 -I -1 -m 0 -M 99999 testuser
No lets configure password aging for the test user. The first example below runs change in interactive mode.
root@testServer:~# chage testuser Changing the aging information for testuser Enter the new value, or press ENTER for the default Minimum Password Age [0]: Maximum Password Age [99999]: 90 Last Password Change (YYYY-MM-DD) [2009-10-16]: Password Expiration Warning [7]: Password Inactive [-1]: Account Expiration Date (YYYY-MM-DD) [1969-12-31]: 2012-12-31
Verify that the settings took.
root@testServer:~# chage -l testuser Last password change : Oct 16, 2009 Password expires : Jan 14, 2010 Password inactive : never Account expires : Dec 31, 2012 Minimum number of days between password change : 0 Maximum number of days between password change : 90 Number of days of warning before password expires : 7
The same can be accomplished using the command line, non-interactively.
root@testServer:~# chage -E 2012-12-31 -I -1 -m 0 -M 90 -W 7 testuser
With the above settings in place, the user should be warned 7 days before the password expires on their account. If the password is not changed before expiration day, on the next login the user will be forced to change their password.

[...] the original post: Linux / Security: User Account Expiration Management « Colocation … Posted in: Security ADD [...]
Linux / Security: User Account Expiration Management « Colocation … | Linux Affinity said this on October 20, 2009 at 8:11 am
[...] Linux / Security: User Account Expiration Management « Colocation to Virtualization blog.colovirt.com/2009/10/20/linux-security-user-account-expiration-management – view page – cached I am a firm believer in regular password rotation/change and Linux has a built in mechanism that makes it easy. The following is a brief overview of password and account ageing for Linux based… (Read more)I am a firm believer in regular password rotation/change and Linux has a built in mechanism that makes it easy. The following is a brief overview of password and account ageing for Linux based systems. (Read less) — From the page [...]
Twitter Trackbacks for Linux / Security: User Account Expiration Management « Colocation to Virtualization [colovirt.com] on Topsy.com said this on October 20, 2009 at 9:22 am