On Tue, Jul 01, 2003 at 07:12:49AM +0100, Jez Hancock wrote:
> I'm attempting to use pw adduser to add a new user to the system and
> would like confirmation that the following is the correct way to set
> the user's password at the same time:
> 
> echo "password" | \
> pw adduser -q -h - -u user -g group -s shell -d /home/user -c comment

I usually just add a user with pw, then use passwd to set a password.
That might be easier, not to mention looking (slightly) more elegant:

pw adduser -q -u user -g group -s shell -d /home/user -c comment
passwd user $passwd

> Can anyone also tell me the security implications of doing this, given
> that the command is executed from a within a script (actually php but
> this is more-or-less irrelevant)?

I don't know, but I'd check how PHP does logging -- you really want to
obfuscate your chosen method of setting the password, if it's gonna go
down in the log...

  Sorry I can't help more,

-lewiz.

-- 
"I belong to no organized party.  I am a Democrat."
                -- Will Rogers
------------------------------------------------------------------------
-| msn:[EMAIL PROTECTED] | jab:[EMAIL PROTECTED] | url:http://lewiz.net |-

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to