The chpasswd command is introduced that allows the user to change the password in non-interactive form, for example from a script.
An example on how to change the password of user adrian to passwd follows:
# chpasswd -?
chpasswd: Not a recognized flag: ?
Usage:
chpasswd [-R load_module] [-e] [ -f flags | -c ]
# chpasswd
adrian:passwd
^D
#
chpasswd: Not a recognized flag: ?
Usage:
chpasswd [-R load_module] [-e] [ -f flags | -c ]
# chpasswd
adrian:passwd
^D
#
The chpasswd command administers users' passwords. The
root user can supply or change users' passwords specified through
standard input. Each line of input must be of the following format.
By default, the chpasswd command sets the ADMCHG flag
for the users. The -f option may be used with other valid
flags to override the default. The -c option clears all
password flags.
The password field can be cleartext or a value encrypted with the crypt algorithm. The -e option indicates that passwords are of encrypted format. Please note that all passwords in a batch must conform to the same format.
username:password
Only
root users can set passwords with this command.
The password field can be cleartext or a value encrypted with the crypt algorithm. The -e option indicates that passwords are of encrypted format. Please note that all passwords in a batch must conform to the same format.
Flags
See Also
No comments:
Post a Comment