On Wed, Apr 25, 2001 at 05:10:00PM +1000, Matthew Melvin <[EMAIL PROTECTED]>
wrote:
| 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.
Indeed you can. Here's some example perl:
http://www.zip.com.au/~cs/scripts/pwcrypt
and some shell using it to edit a passwd file in place:
http://www.zip.com.au/~cs/scripts/pw
Cheers,
--
Cameron Simpson, DoD#743 [EMAIL PROTECTED] http://www.zip.com.au/~cs/
Teamwork is essential. It lets you blame someone else.
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list