On Wed, 25 Apr 2001 at 2:24am (-0700), Wyatt wrote:

> I want to add users through a shell script and have it set the password.
> I may be way off on this but it seems that useradd will not add a
> password for the user. You have to run passwd and get prompted to enter
> the password twice. This won't work if the user is supposed to be added
> through a shell script. I am used to running mkpwent which takes the
> password as an option (for user bob with password junk: mkpwent bob junk
> ....) Is there a way to do this on red hat? Do I need to install third
> party software or NIS?

useradd does accepts a password but in crypted form.  Could use perl crypt
function to do this.  Failing that chpasswd does what you want if you
execute it after you've doen the useradd.  It accepts both clear and
encrypted passwords.  See chpasswd(8) for the gory details...

M.

-- 
WebCentral Pty Ltd           Australia's #1 Internet Web Hosting Company
Level 1, 96 Lytton Road.           Network Operations - Systems Engineer
PO Box 4169, East Brisbane.                       phone: +61 7 3249 2557
Queensland, Australia.                            pgp key id: 0x900E515F



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to