[100055] in RedHat Linux List
Re: how to FORCE setting a password
daemon@ATHENA.MIT.EDU (Kevin Smith)
Wed Nov 18 10:23:53 1998
Date: Wed, 18 Nov 1998 09:28:27 -0600 (EST)
From: Kevin Smith <kevin@mtsu.edu>
To: redhat-list@redhat.com
In-Reply-To: <862566C0.004F74EC.00@domino.prominic.com>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
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`
-----
Kevin Smith
kevin@mtsu.edu
yo-yo, n.:
Something that is occasionally up but normally down.
(see also Computer).
--
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.