How to set expiry date for user in Linux

How to set expiry date for user in linux

In Previous tutorial we learn about how to add a new  user and how to set passwd to user in linux now we will learn about changing the password parameters in linux.
For changing of the password parameters and set
expiry date you need to use the chage command. It will display password expiry
information as well as changes the number of days between password changes and
the date of the last password change. This information is used by the system to
determine when a user must change his or her password.
Changing of the password parameters can be done by
two ways.
<user name>
<option> <value> <username>
Lets see the frist method and then the other.
To set the password parameters of a user “nagios” to
  •             Min password age : 2 days
  •             Max password age : 7 days
  •             Password expiration warnings: 2 days
    before password expires
  •             Password inactive [-1]: 0 same day
    account is locked after password expiry.
  •             A/C expiration date : 2011-12-31
    (dec 31st 2011)


chage nagios


account password detail information:
To see account password detail information such as
expiry date and time, enter:
chage -l <username>
To see account password parameter info for nagios :
chage -l nagios


The second method is for, if you want to change a particular
field of password aging policy
change <option> <value> <username>
The options which can be used are as follows
  •             -m foe Min password age
  •             -M for Max password age
  •             -d for last time the password is
  •             -W password expiration warnings
  •             -I Password inactive [-1 means
  •             -E A/C expiration date


Let’s see how to change only the account expiration
Likewise you can use any option listed above and
change any particular field in password aging parameters.


You Must have to Read This…
If You Like this post then Comment and share Please………………

Leave a Reply

Your email address will not be published. Required fields are marked *