1827997 Members
2925 Online
109973 Solutions
New Discussion

Change password

 
SOLVED
Go to solution
Cheung_2
Frequent Advisor

Change password

How to force user to change linux password regularly ? eg . at the first day of each month. thx.

Andy
3 REPLIES 3
Robert Thorneycroft
Valued Contributor

Re: Change password

You can use something like this to force the user to change their password every 30 days and not within 14 days:

passwd -x 30 -n 14 username

This will not however force all to change on the same day, just within 14-30 days, this is probably advisable however as you don't want to force all users to change on the same day from a support call point of view :)
Chakravarthi
Trusted Contributor
Solution

Re: Change password

passwd -x 30 -n 14

Jerome Henry
Honored Contributor

Re: Change password

Robert's solution works fine, but I still like very much chage command. A chage -M 30 username would have him or her change password every 30 days, but you could also use plenty other options, such as chage -M 30 -W 3 username, which would set a message 3 days before warning that password has to be changed, letting time to think about a new but not too stupid password (like the one users set in a ruch to access the box when password has to be changed right now !). chage is very soft for that and many others things, do a man chage to get full options details, you'll love it.
You can lean only on what resists you...