Change user password expiry information

1) Detail list of user

[raman@inf1sysadm1 ~]$ chage –list raman

Last password change : Jul 06, 2009
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7

2) How set password expiry date

#chage -M 15 raman
-M, –maxdays MAX_DAYS
Set the maximum number of days during which a password is valid.
When MAX_DAYS plus LAST_DAY is less than the current day, the user
will be required to change his/her password before being able to
use his/her account.

[root@inf1sysadm1 ~]# chage –list raman

Last password change : Jul 06, 2009
Password expires : Jul 21, 2009
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 15
Number of days of warning before password expires : 7

3) Force user to Change Password after Expiry Date

#ssh 10.131.11.137 -l raman
raman@10.131.11.137’s password:
You are required to change your password immediately (password aged)
WARNING: Your password has expired.
You must change your password now and login again!
Changing password for user raman.
Changing password for raman.
(current) UNIX password:
New password:
Retype new password:

4) How set expiry date for user

#chage -E “2010-08-12” raman
[root@inf1sysadm1 ~]# chage –list raman
Last password change : Jul 06, 2009
Password expires : Jul 07, 2009
Password inactive : never
Account expires : Aug 12, 2010
Minimum number of days between password change : 0
Maximum number of days between password change : 1
Number of days of warning before password expires : 7

5) User account locked if inactive form last 5 days.

#chage -I 5 raman

-I, –inactive INACTIVE
Set the number of days of inactivity after a password has expired
before the account is locked. The INACTIVE option is the number of
days of inactivity

[root@inf1sysadm1 ~]# chage -l raman
Last password change : Jul 06, 2009
Password expires : Jul 07, 2009
Password inactive : Jul 12, 2009
Account expires : Aug 12, 2010
Minimum number of days between password change : 0
Maximum number of days between password change : 1
Number of days of warning before password expires : 7

6) How disable chage option from user account

#chage -m 0 -M 99999 -I -1 -E -1 raman
* -m 0 will set the minimum number of days between password change to 0
* -M 99999 will set the maximum number of days between password change to 99999
* -I -1 (number minus one) will set the “Password inactive” to never
* -E -1 (number minus one) will set “Account expires” to never.

[root@inf1sysadm1 ~]# chage -l raman

Last password change : Jul 06, 2009
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7

Enjoy 🙂

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: