[100181] in RedHat Linux List
Re: how to FORCE setting a password
daemon@ATHENA.MIT.EDU (Jan Carlson)
Wed Nov 18 18:08:02 1998
Date: Wed, 18 Nov 1998 18:05:01 -0500
From: Jan Carlson <janc@iname.com>
To: redhat-list@redhat.com
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
Kevin Smith wrote:
> On Wed, 18 Nov 1998, Justin Kuntz wrote:
>
> > I am trying to completely automate user creation... I need to create
> > hundreds of accounts and do NOT want to type in the password for each one.
> >
> > I need some kind of shell-script-able sequence such as:
> >
> > useradd <user_name> <home directory> <etc>
> > password <user_name> <password>
> >
>
> Well... assuming you are talking about using a randomly generated
> password, you could use the mkpasswd script... (installed with the
> expect package)
>
> encPass=`/usr/bin/mkpasswd`
>
> Then in your script, just add "-p $encPass" to your useradd command,
> and make note of the password somewhere, so you can issue it to the
> user...
>
> If you intend to actually have a list of users and passwords ready,
> then you could easily write a perl script that will use the crypt
> function to encrypt whatever password is supplied to it, and then
> output the results... then you could just use something like:
>
> encPass=`/usr/local/bin/myCrypt.pl $pass`
Give each user an envelope w his password inside,
tell them to keep it in their underware drawer, and tell them
you charge $5 for lost passwords. Otherwise
you'll spend lots of time issuing new passwords. :-)
--
Jan Carlson
janc@iname.com Scarborough, Ontario, Canada
Mailed with Netscape 4.5 on Red Hat Linux 5.2
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com http://archive.redhat.com
To unsubscribe: mail redhat-list-request@redhat.com with
"unsubscribe" as the Subject.