Adduser utility to generate "random" passwds ?
bsdquestions at gmail.com
Tue Jan 9 16:29:33 UTC 2007
Frank Bonnet wrote:
> 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
> freebsd-questions at freebsd.org mailing list
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe at 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.
PATH=/bin:/user/bin:/usr/local/bin:/; export PATH
cat << EOF
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
<title>Help generating a new password</title>
<h3>Help generating a new password</h3>
These passwords should be reasonably safe.
Feel free to use one, or reload the page
for a new batch.</p>
</blockquote> <pre> <font size="+1">
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' |
printf "Password\tRough guess at pronunciation\n<hr />"
printf "%s%s\t%s %s\n", $1, $3, $2, $4
cat << EOF
rm $a $b
This script is from the book BSD Hacks, enjoy!
More information about the freebsd-questions