generating random passwords

N. Raghavendra raghu at
Wed Jun 11 11:40:53 UTC 2008

At 2008-06-11T09:20:30+02:00, Zbigniew Szalbot wrote:

> Is there a utility in FreeBSD that would allow me to generate random
> passwords without actually creating any accounts or modifying
> existing ones? I am looking for something to allow me to generate a
> random string of characters.

One way is to use the rand(1) command which comes with the base system
as a part of OpenSSL:

  [riemann:/usr/home/raghu]% openssl rand -base64 6
  [riemann:/usr/home/raghu]% openssl rand -base64 9
  [riemann:/usr/home/raghu]% openssl rand -base64 6

Base64 encoding transforms every group of 3 octets to 4 encoded
characters, so `openssl rand -base64 3N' produces a string with 4N
encoded characters.  In case it is relevant, the generated strings are
made up of the 62 US-ASCII alphanumerical characters, `+', and `/'.


N. Raghavendra <raghu at> |
Harish-Chandra Research Institute   |
See message headers for contact and OpenPGP information.

More information about the freebsd-questions mailing list