# Password expiration



## FlorinMarian (Mar 31, 2021)

Hi guys!
I would like to create KVM containers which will come with a default password.
As a security measure I would like to force them to change password at 1st login, how should I proceed?
Thank you!


----------



## ShelLuser (Mar 31, 2021)

Well, passwd(5) comes to mind as well as adduser(8).

Password expiration is supported by the OS itself so that shouldn't be an issue. You can build a skeleton user directory through /usr/share/skel (see also that adduser manualpage) and there you could set up a script which forces users to change their password. When done you'd remove the script and you're set up.


----------



## im (Mar 31, 2021)

Try to set expired password for the user
`pw usermod -n username -p 01-jan-2000` works for me.


----------

