Password expiration

FlorinMarian

Member

Reaction score: 1
Messages: 42

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

Son of Beastie

Reaction score: 2,023
Messages: 3,733

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

Member

Reaction score: 35
Messages: 83

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