LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Chage command (https://www.linuxquestions.org/questions/linux-newbie-8/chage-command-686609/)

mburu 11-27-2008 06:34 AM

Chage command
 
Hi guys,

I implemented the chage command above to users in our server, however a funnny thing happened that I am unable to resolve.
Here is what went on.

>> Before making any changes
# chage -l user
Last password change : Nov 24, 2008
Password expires : Dec 23, 2008
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 29
Number of days of warning before password expires : 10

There are two outputs of chage command I dont understand.
When I run it
# chage -M 65 -m 1 -W 7 -E 14 user
The user is not able to log and is told accout in expired contact system administrator

# chage -M 65 -m 1 -W 7 -E -1 user
Runs fine the results of chage -l user indicate the password does not expire.

What I really want to achieve is to make the accounts of already existing users to expire after certain number of days if password is not changed and at the same time I dont want to lock them out.

Fritz_Monroe 11-27-2008 09:06 AM

I looked in the man page for chage and the -E option needs a date or a number of days after January 2, 1970. So that would be a pretty big number. Try using a -e 2008-12-11 to give them 2 weeks.

Code:

      -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 able to use the system again.

          Passing the number -1 as the EXPIRE_DATE will remove an account
          expiration date.



All times are GMT -5. The time now is 01:55 AM.