How do I set a user password to expire on a specific date?
CMD line. Using Red Hat Ent Linux 5. Thanks in advance.
|
ty the -e switch
from man useradd Code:
-e, --expiredate EXPIRE_DATE |
If the account already exists, try some of the passwd options...
Code:
man passwd This will lock until you (root) either deletes it or unlocks it. I'm assuming you want to lock the credentials out altogether on a set date. |
Thanks for your answer but seems incorrect....
1. I looked there already and my man page states "E" not "e" but that's weird: -E, --expiredate EXPIRE_DATE Set the date or number of days since January 1, 1970 on which the userâs account will no longer be accessible. The date may also be expressed in the format YYYY-MM-DD (or the format more commonly used in your area). A user whose account is locked must contact the system administrator before being ble to use the system again. 2. I am not looking to expire the account. That command expires the account on a date not the password. I am trying to simply set the password expiration date. For example, if I set the -E it will only change the expiry date not the password expire date. See below: "[root@101 etc]# chage -l ed Last password change : Jun 24, 2009 Password expires : never Password inactive : never Account expires : never Minimum number of days between password change : 23 Maximum number of days between password change : 99999 Number of days of warning before password expires : 7 [root@101 etc]# ---- [root@101 etc]# chage -E 2009-07-07 ed [root@101 etc]# chage -l ed Last password change : Jun 24, 2009 Password expires : never Password inactive : never Account expires : Jul 07, 2009 Minimum number of days between password change : 23 Maximum number of days between password change : 99999 Number of days of warning before password expires : 7 [root@101 etc]#" |
Take a look at chage
http://www.thegeekstuff.com/2009/04/...ion-and-aging/ |
Quote:
p.s. The man pages are ok but geared more toward trial and error rather than being real specific. I am fighting with this myself sometimes when trial and error must be the autonomous solution,lol. Still it is much appreciated getting the help on here. Great site! |
All times are GMT -5. The time now is 07:18 PM. |