Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Jan 2006 20:23:31 -0800 (PST)
From:      Philip Hallstrom <freebsd@philip.pjkh.com>
To:        Jose Borquez <bsdlists@sbcglobal.net>
Cc:        FreeBSD Questions group <freebsd-questions@freebsd.org>
Subject:   Re: generating new passwords
Message-ID:  <20060117202240.E9291@wolf.pjkh.com>
In-Reply-To: <43CDBF2A.7040400@sbcglobal.net>
References:  <43CDBF2A.7040400@sbcglobal.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060117202240.E9291>