A simple question - How do I force user set a password the first time they log in Linux server?
And here is the answer
Step # 1: Create the user called foo:
Step # 2: Set the password for user foo:
Step # 3: Now Lock the user account :
Step # 4: Next force expiration:
Step # 5: Finally Unlock the user account:
You can write a script for above procedure. Skip first 2 steps if user exists in system.