Force user to change password at login
Published in
Nov 22, 2023
When we create a new user account in Fedora Linux, say user account douglas, we often set a random password for the account. If we want to force the user to change that password at first login we can use --expire
with the passwd
command.
$ sudo passwd --expire douglas
When douglas logs in, he will receive this message:
WARNING: Your password has expired.
You must change your password now and login again!
Changing password for douglas.
Current password:
Now douglas can choose his own password, unknown for us.