From owner-freebsd-questions@FreeBSD.ORG Fri Sep 12 09:11:34 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 656CD16A4BF for ; Fri, 12 Sep 2003 09:11:34 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id CF0664400E for ; Fri, 12 Sep 2003 09:11:32 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [127.0.0.1]) h8CGAqSk065410 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 12 Sep 2003 17:11:28 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)h8CGAqlk065409; Fri, 12 Sep 2003 17:10:52 +0100 (BST) (envelope-from matthew) Date: Fri, 12 Sep 2003 17:10:52 +0100 From: Matthew Seaman To: thomas may Message-ID: <20030912161052.GC50239@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , thomas may , freebsd-questions@freebsd.org References: <000001c37928$825eced0$8b01a8c0@notebook> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ALfTUftag+2gvp1h" Content-Disposition: inline In-Reply-To: <000001c37928$825eced0$8b01a8c0@notebook> User-Agent: Mutt/1.5.4i X-Spam-Status: No, hits=-11.4 required=5.0 tests=AWL,BAYES_00,EMAIL_ATTRIBUTION,IN_REP_TO,PGP_SIGNATURE_2, QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES, USER_AGENT_MUTT autolearn=ham version=2.55 X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: freebsd-questions@freebsd.org Subject: Re: passwort create with perl X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Sep 2003 16:11:34 -0000 --ALfTUftag+2gvp1h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 12, 2003 at 02:22:11PM +0200, thomas may wrote: > iam searching for a perl programm to create an freebsd user account > password, i dont want to change a password, i want to see it on the > command line, to copy and paste it into another application. You want to input the password to the perl program and get from it the password hash as stored in /etc/master.passwd? This will generate you the MD5 hash: #!/usr/bin/perl -w @pwchars =3D ('a' .. 'z', 'A' .. 'Z', '0' .. '9', '/', '.'); $salt =3D '$1$'; for (1 .. 8) { $salt .=3D $pwchars[rand @pwchars]; } $salt .=3D '$'; print crypt($ARGV[0], $salt), "\n"; Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --ALfTUftag+2gvp1h Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/YfAMdtESqEQa7a0RAl0OAJ9A+1hww/HgJFjREIWjC0DbC6uAtwCfc//d COVNaLcOS848Hvl+0knffl8= =G09l -----END PGP SIGNATURE----- --ALfTUftag+2gvp1h--