This is just a quick
cgi script that was written to enable people to generate random
passwords. This is done via the application mkpasswd
that is available with Red Hat based systems. It is very simple
to use and can be used for many different applications, such as
just supplying it for users on your site or you can use it to assign
a random password to someones account with some simple modifications.
Below is the source code for the cgi file, just paste it into a
file called randpass.cgi
in your /cgi-bin/
directory and chmod 755
it.
#!/bin/csh -f
#
# Random Password Generator 1.0
# Copyright (c) 2001, linuxathome.net All Rights Reserved
# Designed and Coded by Martin (a.k.a. Mayhem)
#
# Latest Information: http://www.linuxathome.net/
# Run the 'mkpasswd' command to get the generated password
set genpass = `mkpasswd`;
# Display output in HTML format
echo "Content-type:text/html\n"
echo "<HTML>"
echo " <HEAD>"
echo " <TITLE>Random Password Generator</TITLE>"
echo " </HEAD>"
echo " <BODY BGCOLOR=#FFFFFF>"
echo " <CENTER>"
echo " <FONT FACE=ARIAL><P>"
echo " <B>Your Random Password is:</B> $genpass "
echo " </FONT></P>"
echo " <FONT FACE=ARIAL SIZE=2 COLOR=#CCCCCC>"
echo " Copyright © 2001 www.linuxathome.net, All Rights Reserved."
echo " </FONT>"
echo " </CENTER>"
echo " </BODY>"
echo "</HTML>"
The script will output
something like this (you may cutomise it as you see fit):
|