Force a user to change their Linux password

I had to setup a new user on a Linux server and I wanted to give them a temporary password and make them change it after their first login. You can use the chage command to control when a password expires (and requires a change). Create a new user and give them a default password. Then set that user's password to expire immediately.

chage -d0 username

This will set the password for username to expire in 0 days.

Leave A Reply
All content licensed under the Creative Commons License