How do I force users to change their passwords upon the first login?

Updated -

1.) Firstly, lock the account to prevent the user from using the login until the change has been made:

# usermod -L <username>

2.) Change the password expiration date to 0 to ensure the user changes the password during the next login:

# chage -d 0 <username>

3.) To unlock the account after the change do the following:

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content