Skip to content

Instantly share code, notes, and snippets.

@jdeathe
Created September 1, 2017 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdeathe/1f423576b00dff94a1ccd186868aefa7 to your computer and use it in GitHub Desktop.
Save jdeathe/1f423576b00dff94a1ccd186868aefa7 to your computer and use it in GitHub Desktop.
CentOS - How to Remove a User's Password and Require a New Password on First Access

CentOS - How to Require Password Change.

Running the following command, as the root, removes the existing password and forces password change on first login for the for the user "root".

# passwd -d root \
  && chage -d 0 root

When root next logs in they will receive the following message:

You are required to change your password immediately (root enforced)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment