Am 29.03.2012 23:16, schrieb pete:
On Thu, 29 Mar 2012 22:11:31 +0100
pete<p.nikol...@btinternet.com>  wrote:


Hi ..

I need to generate a htaccess file that has 150 username password
pairs  does anyone know of a utility that can do this short of lots of
typing ..


Thanks   Pete .


Maybe i should correct that slightly  i need to generate  .htpasswd
file with 150 user password pairs ..

Pete .


something like this?

#!/bin/sh

while read usr; do
        echo "$usr:$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 16)"\
                >> .htpasswd
done < users

In the 'users' file your users are listed (one per line). NOTE: you cant be sure that the passwords are unique

cheers

Reply via email to