Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jun 2008 17:05:03 +0530
From:      "N. Raghavendra" <raghu@mri.ernet.in>
To:        z.szalbot@lc-words.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: generating random passwords
Message-ID:  <8663sgdx20.fsf@riemann.mri.ernet.in>
In-Reply-To: <484F7CBE.5060401@lc-words.com> (Zbigniew Szalbot's message of "Wed, 11 Jun 2008 09:20:30 %2B0200")
References:  <484F7CBE.5060401@lc-words.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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
  1olqAkXG
  [riemann:/usr/home/raghu]% openssl rand -base64 9
  gO/9nTp5/SYa
  [riemann:/usr/home/raghu]% openssl rand -base64 6
  ib9SrIe2

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 `/'.

HTH,
Raghavendra.

-- 
N. Raghavendra <raghu@mri.ernet.in> | http://www.retrotexts.net/
Harish-Chandra Research Institute   | http://www.mri.ernet.in/
See message headers for contact and OpenPGP information.




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