I'm trying to setup a Samba server which asks new users to change their password on their first login and makes passwords expire after 90 days.

I was able to setup the 90 days expiry date but the --pwd-must-change-time doesn't work.

The verbose shows as the data was changed but when I run -Lv it still shows the “must change time” for 90 days ahead.

  • 1
    How does changing your password every 90 days increase security? (Answer: generally speaking, it doesnt'.) Commented Dec 2, 2011 at 23:43
  • @Gilles, thanks for your reply but I don't recall stating I was trying to increase security. It's just a feature I'd like to add so I don't have to manage that. But anyway, I was able to setup the 90 days expiry date and also setup user to change their password on first logon. My new problem is: Windows-XP doesn't prompt for user's new password. It only tells them they must change their password. How can I enable users to change their passwords from Windows XP? Commented Dec 5, 2011 at 15:04
  • The exact error message is: System error 1907 has occurred. The user's password must be changed before logging on the first time. Commented Dec 5, 2011 at 15:06
  • That's a different question. Since you've found an answer to your original question, please share it (use the “Answer Your Question” button). For the Windows XP part, we on the Unix site can't help, I suggest you ask on Super User (a site for users of Windows and Linux) or Server Fault (a site for professional system administrators). Commented Dec 5, 2011 at 16:49
  • @Giles: wow, thanks for the update. I actually had posted my question at stackflow, not here. Someone migrated it. I'll add the answer to the original question. Thanks. Commented Dec 5, 2011 at 16:55

1 Answer 1


I found a solution to my original question.

At first you can set up the 90-day-expiration policy like I did.

sudo pdbedit -P "maximum password age" -C *time-in-seconds*

Then in order to make the user change his password at first login just type

sudo net sam set pwdmustchangenow *user* yes

The problem I'm having now is that Windows does not allow a user to change their password. It only alerts them that they need to change their password. I'm posting a new question about this new error.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .