Password Generation Under Linux

Requires the expect package http://expect.nist.gov/

Save the following to /cgi-bin/

#!/bin/sh

length=8
special_chars=0
pass=`/usr/bin/mkpasswd -l $length -s $special_chars`

echo "Content-Type: text/html"
echo
echo "<HTML><HEAD><TITLE>Password Generated</TITLE></HEAD>"
echo "<BODY><H1>"
echo "Password:&nbsp;&nbsp;&nbsp;&nbsp;$pass"
echo "</H1></BODY>"