From owner-freebsd-questions Sun Aug 20 22:37:28 2000 Delivered-To: freebsd-questions@freebsd.org Received: from fedde.littleton.co.us (fedde.littleton.co.us [216.17.174.44]) by hub.freebsd.org (Postfix) with ESMTP id 7624D37B43E for ; Sun, 20 Aug 2000 22:37:26 -0700 (PDT) Received: from fedde.littleton.co.us (localhost [127.0.0.1]) by fedde.littleton.co.us (8.11.0/8.11.0.Beta3) with ESMTP id e7L5bNj25784; Sun, 20 Aug 2000 23:37:23 -0600 (MDT) Message-Id: <200008210537.e7L5bNj25784@fedde.littleton.co.us> To: D M P Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Encrypting a password for insertion using chpass(1)? In-Reply-To: <39A099E1.51E6B546@aracnet.com> From: Chris Fedde Date: Sun, 20 Aug 2000 23:37:23 -0600 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 20 Aug 2000 19:54:25 -0700 D M P wrote: +------------------ | I need to syncronize a server's user passwords to those in a database. | The database spits out cleartext passwords. I have to somehow get | those into the password database on the server. The first way I came | up with was calling chpass(1) and feeding it the new password, but | according to the man page, it will only take encrypted passwords, not | cleartexts. | | How do I encrypt a password so I can insert it using chpass? | | Is there another way I can do this? +------------------ Sure there is. You can create unix des style encrypted passwords realy easy. Here is perl that does it: perl -le 'print crypt("foo", "foo")' Note that "foo" is used for both the password and the salt. This technique should be at least as secure as keeping the cleartext passwords in a database server ;-} chris -- Chris Fedde 303 773 9134 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message