From owner-freebsd-questions@FreeBSD.ORG Tue Jan 9 16:29:33 2007
Return-Path:
X-Original-To: freebsd-questions@freebsd.org
Delivered-To: freebsd-questions@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
by hub.freebsd.org (Postfix) with ESMTP id A009716A403
for ;
Tue, 9 Jan 2007 16:29:33 +0000 (UTC)
(envelope-from michael@ircgnet.net)
Received: from ws6-8.us4.outblaze.com (ws6-8.us4.outblaze.com [205.158.62.24])
by mx1.freebsd.org (Postfix) with SMTP id 8239B13C480
for ;
Tue, 9 Jan 2007 16:29:33 +0000 (UTC)
(envelope-from michael@ircgnet.net)
Received: (qmail 10653 invoked from network); 9 Jan 2007 16:02:53 -0000
Received: from unknown (HELO ?127.0.0.1?) (michael@ircgnet.net@67.168.235.146)
by ws6-8.us4.outblaze.com with SMTP; 9 Jan 2007 16:02:53 -0000
Message-ID: <45A3BC39.1050503@gmail.com>
Date: Tue, 09 Jan 2007 08:00:57 -0800
From: Michael
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
To: freebsd-questions@freebsd.org
References: <45A22099.3060208@esiee.fr>
In-Reply-To: <45A22099.3060208@esiee.fr>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Subject: Re: Adduser utility to generate "random" passwds ?
X-BeenThere: freebsd-questions@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: User questions
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Tue, 09 Jan 2007 16:29:33 -0000
Frank Bonnet wrote:
> Hello
>
> Is there a possibility to use as a standalone software
> the adduser feature that generate "random" passwd.
>
> I want to generate new "strong" password for existing users.
>
> Thank you
>
> Frank
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe@freebsd.org"
>
Another good choice for separate password generation is apg which is
also in the ports. What I like about apg is that it also provides a
basic phonic for each password you can generate that helps you to
remember your password. As you may already know, having completely
ambiguous random passwords isn't necessarily the best thing to use since
most users will tend to write them down on paper somewhere and defeat
the real purpose for generating good secure passwords in the first place.
Here is a small script that can generate these passwords via a web
interface which is quite nice. It does require that you have a ksh
shell however since it was written with this shell in mind.
#!/usr/local/bin/ksh93
PATH=/bin:/user/bin:/usr/local/bin:/; export PATH
umask 077
a=/tmp/apg.$RANDOM
b=/tmp/apg.$RAMDOM
cat << EOF
Content-type: text/html
Help generating a new password
Help generating a new password
These passwords should be reasonably safe.
Feel free to use one, or reload the page
for a new batch.
EOF
apg -q -m 4 -x 4 -M NC -E '!@#$%^&*()\\' -n 10 > $a
apg -q -m 4 -x 4 -M S -E '!@#$%^&*()\\' -n 10 > $b
# tr command is for bug workaround; apg is not supposed to
# include characters specified after -E option
paste $a $b |
tr 'l' 'L' |
awk '
BEGIN {
printf "Password\tRough guess at pronunciation\n
"
}
{
printf "%s%s\t%s %s\n", $1, $3, $2, $4
}'
cat << EOF
EOF
rm $a $b
exit 0
This script is from the book BSD Hacks, enjoy!
Michael Lawver