Where and how exactly I can set the expiration time of password of users i.e.the time after which the UNIX OS prompts user after giving some warnings that your password will expire with in n days and then expire the user's password?
Asked
Active
Viewed 4,782 times
3 Answers
2
Maybe you want to take a look at the chage command.
chage -l john
Last password change : May 22, 2007
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
wishi
- 211
1
It is not part of the Unix standard, and is completely different depending on what OS you are using, and if you are using some sort of directory service. If you want to know you need to specify what OS you are using, and if it is Linux you probably need to specify what distro.
Louis Gerbarg
- 111
-
Louis, I am using linux,and I need to configure such setting that the passwords for all users will expire after a definite time. – Nov 05 '09 at 10:23
-
@Sachin, Louis asked that you state what distro you're using. From what I understand this feature is not a standard on UNIX/Linux systems but may be available on some Linux distro. So let us know which one you're using. – Helen Nov 05 '09 at 10:49
-
@Helen, I knew this is not a part of standard , but this is some what I need to conmfigure so as to achieve the automatic password expiration facility and thus to ensure the security. – Nov 05 '09 at 11:13
-
can you please list your distro -- preferably the output of
cat /etc/issue– phoenix8 Nov 05 '09 at 12:04
1
But you need to use the passwd command with the maxdays and warndays set:
e.g. passwd --maxdays 10 --warndays 5 user
would set the maxdays between password changes as 10, and give 5 days warning.
EDIT: So if you have a list of usernames in a text file one per line then the following might work:
cat usernamelist | while read $a; do passwd --maxdays 10 --warndays 5 $a; done
RobS
- 136
-
1This work well if I am the user, what if I need to do it for all users and I am not the uder but the admin. – Nov 05 '09 at 10:48
-