Tips for APG
This page contains some tips for APG.
1. Elimination of certain characters from the output.
2. APG and xinetd.
3. APG and PHP script.
I don't like to use "o"'s or "l"'s in my passwords because they looke like zeros and ones instead of O's and L's.
I hacked together a little shell script to accomplish the elimination of certain characters from the output.
--------> [cut here]
#!/bin/sh
genpw () {
PW=$(/usr/local/bin/apg -L -m 10 -x 10 -n 1 | egrep -v [owl])
if [ "$PW" != "" ]; then
echo $PW
return 0;
else
return 1;
fi
}
until genpw; do : ; done
--------> [cut here]
I use xinetd instead of inetd as per your documentation, so I hope you (or anyone using apgd) might find usefull this xinetd.conf entry. Arguments are tailored according to my needs, but that shouldn't be a problem for anyone that read man pages ...
--------> [cut here]
# default: on
# description: APGD is a deamon that returns randomly generated password
service pwdgen
{
port = 129
socket_type = stream
wait = no
only_from = localhost
user = pismonosa
server = /usr/local/sbin/apgd
server_args = -M ln -n 1 -m 6 -x 8 -a 1
instances = 1
log_on_failure += USERID
disable = no
}
--------> [cut here]
After building and installing APG, you must make it easily available. The simplest is as a web-page reference. The simplest way to do this is by a php script located in the root of the web server's data tree:
--------> [cut here]
<html>
<body>
<pre>
<?
$foo = `/usr/local/bin/apg -n 20`;
echo $foo
?>
</pre>
</body>
</html>
--------> [cut here]