generating new passwords
Philip Hallstrom
freebsd at philip.pjkh.com
Tue Jan 17 20:23:49 PST 2006
> Is there a command in FreeBSD 5.4 that will assign a specified user a new
> password without having to create one manually using passwd? Is there also a
> way to generate new passwords for multiple users at once?
man pw
...
-h fd This option provides a special interface by which interac-
tive scripts can set an account password using pw. Because
the command line and environment are fundamentally insecure
mechanisms by which programs can accept information, pw
will only allow setting of account and group passwords via
a file descriptor (usually a pipe between an interactive
script and the program). sh, bash, ksh and perl all pos-
sess mechanisms by which this can be done. Alternatively,
pw will prompt for the user's password if -h 0 is given,
nominating stdin as the file descriptor on which to read
the password. Note that this password will be read only
once and is intended for use by a script rather than for
interactive use. If you wish to have new password confir-
mation along the lines of passwd(1), this must be imple-
mented as part of an interactive script that calls pw.
If a value of `-' is given as the argument fd, then the
password will be set to `*', rendering the account inacces-
sible via password-based login.
-H fd Read an encrypted password string from the specified file
descriptor. This is like -h, but the password should be
supplied already encrypted in a form suitable for writing
directly to the password database.
More information about the freebsd-questions
mailing list