chpasswd Linux Commands

What is Linux chpasswd Command?

Explanation

chpasswd COMMAND:

chpasswd command is used to change password for users. This is an admin command, Only root user can change the password for users.

SYNTAX :


chpasswd [options]

OPTIONS:


-c Clears all password flags.
-e Specifies that the passwords are of encrypted format.
-f flags Specifies the comma separated list of password flags to set. Valid flag values are: ADMIN, ADMCHG, and/or NOCHECK. Refer to the pwdadm command documentation for details about these values.
-R load_module Specifies the loadable I & A module used to change user's password.

EXAMPLE:


  1. To reset password for users from command line,type
    chpasswd

    Followed by entering username:password pairs, one pair per line. Enter ctrl+D when finished.

    user1:passwd1
    user2:passwd2
    ....

Ask Questions

Ask Question