How do I force password reset and expiration of new user
I need to be able to create new user accounts and make sure they're forced to reset their password upon first login, also if they don't log in within 4 days of the account creation their account must automatically lock. How do I accomplish this?
thank you. |
'chage -d 0 username' will do the first part.
As for expiring accounts, well try 'chage -E $(date -d "+4 day" +"%D")' You may need to play around with it to get the date input to work but you get the idea. Now how to tie that up with with a user never logging in, you will need to script it somehow, possibly write a cron job that will check chage -l for all users, grep the info you want and use that as a determination whether they satisfy your locking requirement. Give it a go and see what you come up with. |
You can force a change of password by next login with passwd.
Not sure how well it'll work on batch creating users but for one at a time works well Code:
-e, --expire |
Quote:
|
This may be of interest:
Code:
-i, --inactive INACTIVE This is in the man pages of passwd Code:
man passwd |
Great replies, thanks very much guys!
|
All times are GMT -5. The time now is 10:37 PM. |