Velmi zjednodušeně se to dá řešit přes squid.
Používáme to v nemocnici pro přístup pacientů na internet, kdy musí zadat jméno a heslo do prohlížeče.
Jméno a heslo se automaticky generuje do txt souboru.
squid.conf:
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/uzivatele.pass
auth_param basic realm Tento text se zobrazi v prohlizeci
i s novymi radky
uzivatele.pass:
jmeno:heslo
Heslo se generuje pomocí perloveho skriptu:
#!/usr/bin/perl
# Perl code to create and print SHA1 and MD5 hashes of passwords
# shamelessly stolen from the openLDAP Faq-O-Matic
# written 19-Jul-01 by Ed Truitt
# Updated 12-Oct-01 to include a {crypt} version of the password
$theGoodWord = $ARGV[0];
print $theGoodWord . "\n";
chomp($theGoodWord);
# First, print the clear text version
# Now generate and print the CRYPT version
# first we need to generate the salt
@chars = ("A" .. "Z", "a" .. "z", 0 .. 9, qw(. /) );
$salt = join("", @chars[ map { rand @chars} ( 1 .. 4) ]);
# now to generate the password itself
$cryptPasswd = crypt($theGoodWord,$salt);
print $cryptPasswd . "\n";