Hello - is there a way within a script to reset a password that is SOON to be expired? will passwd -u reset the counter to expire? or is there another command that will? THanks
Edited by: user1466636 on Aug 23, 2012 7:10 AM
You could just change the date in the /etc/shadow file. This will give you more time. The 3rd field is the last password change field and this will be the part you will need to change. This fix works on local accounts and you need to be root to edit the shadow file.
Also passwd -x does the same thing as above.
# passwd -x 90
The example above sets your account to have 90 days between password changes. Again you need to be root.
If your a NIS, NIS+ or LDAP user then you can do this.
# passwd -r files -x 90
In the example above only use -r with one option like -r ldap. Again you need to be root.
You can also use usermod to modify the user account. Again you need to be root.
yes, "passwd -u" resets the expiration counter and will be safer than manually editing the /etc/shadow file. this will also keep you in line with any existing security requirements as opposed to eliminating the expiration or extending the time period.