On Thu, 2007-04-26 at 07:35 +0200, Joachim Backes wrote:
Tim wrote:
> On Wed, 2007-04-25 at 18:38 -0600, Ashley M. Kirchner wrote:
>> Anyone have pointers (or examples) of a script that can be used to
>> create new users and set their password at the same time? I need
>> something I can call like so:
>>
>> script USERNAME PASSWORD
>>
>> ...and have it return 1 or 0 for failure or success.
>
> You can't use "useradd" as it already stands?
>
I think the problem is the password.
Splitting the script in to parts:
1. useradd .... $1 .......
2. password --stdin <<"EOF"
$2
EOF
so if you call
script <USERNAME> "<PASSWORD>"
the password should be set correctly.
The problem as I see it is to generate
passwds automatically. There used
to be a program mkpasswd that did that but I can't find that now.
--
=======================================================================
"One size fits all": Doesn't fit anyone.
=======================================================================
Aaron Konstam telephone: (210) 656-0355 e-mail: akonstam(a)sbcglobal.net