From owner-freebsd-questions@FreeBSD.ORG Wed Jun 11 11:40:53 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AD0E106567E for ; Wed, 11 Jun 2008 11:40:53 +0000 (UTC) (envelope-from raghu@mri.ernet.in) Received: from hrimail.hri.res.in (hrimail.hri.res.in [210.212.50.7]) by mx1.freebsd.org (Postfix) with ESMTP id 3DDF98FC15 for ; Wed, 11 Jun 2008 11:40:52 +0000 (UTC) (envelope-from raghu@mri.ernet.in) Received: from ipc2.mri.ernet.in (unknown [192.168.3.2]) by hrimail.hri.res.in (Postfix) with ESMTP id 2161797E57; Wed, 11 Jun 2008 17:17:22 +0530 (IST) Received: from ipc2 (localhost [127.0.0.1]) by ipc2 (Postfix) with SMTP id 36C7A1DF26; Wed, 11 Jun 2008 17:10:44 +0530 (IST) Received: from riemann.mri.ernet.in (riemann.mri.ernet.in [192.168.3.122]) by ipc2.mri.ernet.in (Postfix) with ESMTP id E42451D900; Wed, 11 Jun 2008 17:10:43 +0530 (IST) Received: from riemann.mri.ernet.in (localhost [127.0.0.1]) by riemann.mri.ernet.in (8.13.6/8.13.6) with ESMTP id m5BBZMfw058952; Wed, 11 Jun 2008 17:05:22 +0530 (IST) (envelope-from raghu@riemann.mri.ernet.in) Received: (from raghu@localhost) by riemann.mri.ernet.in (8.13.6/8.13.6/Submit) id m5BBZ3fA058951; Wed, 11 Jun 2008 17:05:03 +0530 (IST) (envelope-from raghu) From: "N. Raghavendra" To: z.szalbot@lc-words.com In-Reply-To: <484F7CBE.5060401@lc-words.com> (Zbigniew Szalbot's message of "Wed, 11 Jun 2008 09:20:30 +0200") References: <484F7CBE.5060401@lc-words.com> X-Organization: Harish-Chandra Research Institute (HRI) X-Address: Chhatnag Road, Jhusi, Allahabad 211 019, India X-URL: http://www.mri.ernet.in/ and http://www.retrotexts.net/ X-Phone: +91 (532) 2667 509, 2667 318, 2667 578, 2567 746, 2567 747 X-Fax: +91 (532) 2667 576, 2567 748, 2567 444, 2568 036 X-OpenPGP-Key-ID: 0x03618806 X-OpenPGP-Key-Fingerprint: C75D D0AF 457E 7454 BEC2 37AD C6E1 0407 0361 8806 X-OpenPGP-Public-Key-Available-At: http://www.keyserver.net/ Date: Wed, 11 Jun 2008 17:05:03 +0530 Message-ID: <8663sgdx20.fsf@riemann.mri.ernet.in> User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-questions@freebsd.org Subject: Re: generating random passwords X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "N. Raghavendra" List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2008 11:40:53 -0000 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 | http://www.retrotexts.net/ Harish-Chandra Research Institute | http://www.mri.ernet.in/ See message headers for contact and OpenPGP information.