Re: SQL user generation script

2003-09-08 Thread Tom Emerson
On Sunday 07 September 2003 2:40 am, jc fulknier wrote:
> is there a script to auto generate users and passwds
> into a mySQL DB?
 
Here is one I use:

=
#!/bin/sh
#
# usage: radadd
#
# creates a range of users from start to end with randomized passwords
# "format" should be a format string for the "seq" command, and is
# generally in the form "%0g"
# where "digit" refers to how many digits are in the "sequence"
#
rm /tmp/hgusers /tmp/hgpass
for uid in `seq -f"$1" $2 $3`;do
  echo insert into usergroup values \(0,\"$uid\",\"$4\"\)\; >>/tmp/hgusers
  echo insert into radcheck  values [line continues] 
\(0,\"$uid\",\"Password\",\"==\",\"`randpass`\"\)\; >>/tmp/hgpass; done
cat /tmp/hgusers /tmp/hgpass | mysql -h  [continues]
   -u  -p 
=

[when cutting/pasting, fix the "line continues" parts, and insert appropriate 
 for your MySQL database...]

the temp files, hgusers & hgpass, can be deleted afterwords or reviewed to see 
what was added this time around.

the routine "randpass" generates the actual password -- this is my version, 
but you can create one that makes passwords in whatever format you require 
[upper vs. lower case, alpha vs. numeric, special symbols, length, etc.]

=
#!/usr/bin/perl
my $c="bcdfghjklmnpqrstvwxyz";
my $v="aeiou";

for ($i=0;$i<4;$i++) {print substr($c,rand(21),1),substr($v,rand(5),1)};
=

This deceptively simple routine generates passwords that are, for the most 
part, pronounceable and rememberable without having to write them down [the 
words look to be asian or hawaiian, though occaisionally a recognizable 
english word will be generated, such as "rope" or "vase"] however since it 
produces an 8-character password, you'll end up with "ropevase" as a password

-- 
Yet another Blog: http://osnut.homelinux.net


pgp0.pgp
Description: signature


Re: SQL user generation script | scripts/create-users.pl rewrite

2003-09-08 Thread Ulrich Walcher
I just did a little rewrite on the script I use...

http://www.bcore.de/data/create-users.tar.gz

It should now fit to the most common needs...

Cheers,
OoLee


Am Son, 2003-09-07 um 11.40 schrieb jc fulknier:
> is there a script to auto generate users and passwds
> into a mySQL DB? 
> Thanks
> JC
> 
> __
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> 
> - 
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
> 


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


SQL user generation script

2003-09-07 Thread jc fulknier
is there a script to auto generate users and passwds
into a mySQL DB? 
Thanks
JC

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html