Monday, November 24, 2014

How to increase Password Expire date without resetting the password


It is commonly used that when we have to increase the password expire date of any user we simply reset the password of that user .
But we can increase the Password Expire date of user without resetting the password.
Here is the below scenario –

[root@server ~]# chage -l linux
Last password change : Nov 22, 2010
Password expires : Feb 20, 2011
Password inactive : never
Account expires : never
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
[root@server ~]#

In above sentence  Last password change,Password expires & Maximum number of days between password change is important fields.
Here the “Maximum number of days between password change” has value 90 days.
So on the basis of this we will increase the Password Expire date.
for above scenario use the command :
chage -d 2011-02-20 linux
Here in above command we have changed the “last password change” value .
So by doing this it will automatically add 90 days and give new value in “Password Expires
Check the below result
[root@server ~]# chage -l linux
Last password change : Feb 20, 2011
Password expires : May 20, 2011
Password inactive : never
Account expires : never
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
[root@server ~]#

No comments:

Post a Comment