[Inschool] Scripts

Eric Anderson inschool@kalamazoolinux.org
Thu, 17 Jul 2003 20:53:37 -0500


Way that I would go about it, rather than using a script, is as follows.

Are you using shadow file authentication? I'm going to assume that you are.

create one user using the useradd command.
set password using passwd, as root.
run pwunconv. (This will change change the file that the system is using for
authentication back to /etc/passwd.
Copy the line for the user that you created back into the /etc/passwd file
change the appropriate parts of the line. For instance, an account for usertest
with a password of test would look like this...

usertest:$1$zXP.S0sb$GhykBUMY87y6hfbZ/VzLp0:523:523::/home/usertest:/bin/bash

You'll want to make sure that the uid and gid are unique (you'll have to add the
gid to /etc/groups)

Create home directories with the appropriate permissions

run pwconv (convert back to shadow file)

What this will do, is permit you to add the users without having to repeat the
password for every account when you set the password. Because you have to
manually create the data file with the username/password, etc anyway, you're
going to save yourself much work by doing it this way, as opposed to doing it
with the script, which you'll have to manually create the datafile.

Hope this helps. If you need assistance with anything, let me know.

Eric Anderson
LanRx Network Solutions
815-505-6132


Quoting John Van Horn <jvanhorn@t-one.net>:

> No, there can be other fields. I am creating the text file specifically for
> this purpose. I have not been able to even read in 1 field let alone many
> fields.
> 
> Got some Ideas?
> 
>    John
> 
> 
> ----- Original Message -----
> From: "Eric Anderson" <Eric.Anderson@LanRx.com>
> To: <inschool@kalamazoolinux.org>
> Sent: Thursday, July 17, 2003 2:02 PM
> Subject: Re: [Inschool] Scripts
> 
> 
> > Are those the only four fields in the file? Are you working with an HR
> Export,
> > or something?
> >
> > Eric Anderson
> > LanRx Network Solutions
> > 815-505-6132
> >
> >
> > Quoting John Van Horn <jvanhorn@pentwater.k12.mi.us>:
> >
> > > Well... my script does not operate properly
> 
> > >
> > > Anyone have a script to add many users using an existing text list in:
> > >
> > > username  password  Firstname Lastname
> > >
> > > format, one per line.
> > >
> > > John
> > >
> >
> > LanRx Network Solutions, Inc.
> > Providing Enterprise Level Solutions...On A Small Business Budget
> > _______________________________________________
> > Inschool mailing list
> > Inschool@kalamazoolinux.org
> > http://www.kalamazoolinux.org/mailman/listinfo/inschool
> 
> 
> _______________________________________________
> Inschool mailing list
> Inschool@kalamazoolinux.org
> http://www.kalamazoolinux.org/mailman/listinfo/inschool
> 

LanRx Network Solutions, Inc.
Providing Enterprise Level Solutions...On A Small Business Budget