Password AgingFor security reasons, it is advisable to require users to change their passwords periodically. This can be done when adding or editing a user on the Password Info tab of the User Manager.
To configure password expiration for a user from a shell prompt, use the
chage command with an option from Table 15.3, “ chage Command Line Options”, followed by the username.ImportantShadow passwords must be enabled to use the
chage command. For more information, see Section 15.6, “Shadow Passwords”.Table 15.3.
|
Option | Description |
---|---|
-d <days> |
Specifies the number of days since January 1, 1970 the password was changed |
-E <date> |
Specifies the date on which the account is locked, in the format YYYY-MM-DD. Instead of the date, the number of days since January 1, 1970 can also be used. |
-I <days> |
Specifies the number of inactive days after the password expiration before locking the account. If the value is 0, the account is not locked after the password expires. |
-l |
Lists current account aging settings. |
-m <days> |
Specify the minimum number of days after which the user must change passwords. If the value is 0, the password does not expire. |
-M <days> |
Specify the maximum number of days for which the password is valid. When the number of days specified by this option plus the number of days specified with the -d option is less than the current day, the user must change passwords before using the account. |
-W <days> |
Specifies the number of days before the password expiration date to warn the user. |
chage
command is followed directly by a username (with no options), it displays the current password aging values and allows them to be changed interactively.python
command. It displays the following:Python 2.4.3 (#1, Jul 21 2006, 08:46:09) [GCC 4.1.1 20060718 (Application Stack 4.1.1-9)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
<password>
with the password to encrypt and <salt>
with a random combination of at least 2 of the following: any alphanumeric character, the slash (/) character or a dot (.):import crypt; print crypt.crypt("<password>
","<salt>
")
'12CsGd8FRcMSM'
.<encrypted-password>
with the encrypted output of the Python interpreter):usermod -p "<encrypted-password>
"<username>
usermod -p "" username
chage -d 0 username
Published under the terms of the Creative Commons License | Design by Interspire |