[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
RE: [K12OSN] Password file
- From: Bert Rolston <bert rolston clear net nz>
- To: K12OSN <k12osn redhat com>
- Subject: RE: [K12OSN] Password file
- Date: Wed Apr 2 18:27:02 2003
Hi all,
YES, the user module will add users en masse.
I used a word processor and merge file to create the user batch file.
I took longer to set up the merge files and test that it took to import
500 students.
Webmin also updates in other modules, therefore the SAMBA passwords were
created successfully.
I also used another merge file with the same data to create all of the
student SAMBA shares for the smb.conf file. I agree that dynamic
creation of these shares is the preferred method, but 500 shares isn't
that many.
Once the merge files have been created they are reusable.
Export the student data from your database as a .csv file and use this
as the base for the merge data.
Check the archives over the last 6 or so months, I've covered this
before in some detail.
Cheers,
Bert
On Thu, 2003-04-03 at 08:45, Jim Hays wrote:
> Isn't there a WebAdmin module that lets you batch add users?
>
>
> -------------------------------------------
> Jim Hays, Technology Director
> Monticello CUSD#25
> #2 Sage Drive
> Monticello, IL 61856
> haysja sages us
> Phone - 217-762-8511 ext 208
> E-Fax - 1-240-201-6257
> ------------------------------------------------------------
>
>
> -----Original Message-----
> From: k12osn-admin redhat com [mailto:k12osn-admin redhat com] On Behalf Of
> Trond Mæhlum
> Sent: Wednesday, April 02, 2003 2:05 PM
> To: k12osn redhat com
> Subject: Re: [K12OSN] Password file
>
> I am about to generate 300 users. This could be what I'm looking for.
> Excuse me if this is a stupid question, but how can I use this or
> something similar to auto generate 300 users with passwords. I was
> looking at typing in 300 users manually. If this can be done
> automatically, how can I get a printout of the users with the passwords?
>
> Trond Mæhlum
>
> Jennifer Waters wrote:
>
> >Eric Harrison wrote a perl script for me to create a
> >password file. I needed one that would create a
> >password file of all the students in the school,
> >without me having to hand input the names and
> >passwords. Eric did this and it worked great. It
> >created a name and password for each student. The
> >only problem is that it does not create a shadow file.
> > Without the shadow file, we cannot access the names
> >that have been created. I have been working on this
> >for almost two years, but I know I am getting closer
> >to having a finish product that I can use without a
> >lot of fuss. I needed something that is easy to use
> >and others can use if I am not here. I tried using
> >some other suggestions, but I couldn't seem to get
> >them working and you still had to create the password
> >yourself. This I did not want to do with almost 1,300
> >names.
> >
> >I still need to add to the shadow file and samba
> >password file. I have a lot of Windows 98 and 2000
> >machines. The Windows 98 machines are easy to use,
> >but the Windows 2000 machines are real stinkers. I
> >still haven't figured what and how I need to do to
> >connect these machines to my LTSP servers. In Windows
> >2000 you have to log in and it looks at a file on the
> >computer, but I want it to look at the server. I need
> >to learn how to do this. I received recommendations
> >earlier, but I couldn't quiet figure out what to do.
> >Can someone give me directions that are very simple.
> >
> >Here is the script that Eric wrote for me that creates
> >the password file. Can someone tell me how to add the
> >shadow file, and to create the smbpasswd file by
> >adding to this script to creating a new one.
> >
> >#!/usr/bin/perl
> >
> >#
> ># 1 = first name, last initial, graduation year
> ># 2 = first initial, last name, graduation year
> ># 3 = first name, last name
> >$UserNameType = 2;
> >
> >open (PW, "</etc/passwd");
> >open (OUT,">>/root/password_list");
> >while (<PW>) {
> > chomp;
> > ($uid,$junk) = split /:/, $_;
> > $seen{$uid} = 1;
> >}
> >
> >while (<>) {
> > chomp;
> > s/
> >//g;
> > s/ /-/g;
> > s,/,-,g;
> > s/'//g;
> > $i = "2";
> > ($fn, $ln, $grad) = split /,/, $_;
> > chomp $grad;
> > if ($UserNameType == 3) {
> > $username = lc("$fn_$ln");
> > while ($seen{$username}) {
> > $username = lc("$fn_$ln$i");
> > $i++;
> > }
> > } elsif ($UserNameType == 2) {
> > $start = substr($fn, 0, 1);
> > $end = substr($ln, 0, 7);
> > $username = lc("$start$end$grad");
> > while ($seen{$username}) {
> > $username = lc("$start$end$i$grad");
> > $i++;
> > }
> > } else {
> > $end = substr($ln, 0, 1);
> > $username = lc("$fn$end$grad");
> > while ($seen{$username}) {
> > $username = lc("$fn$end$i$grad");
> > $i++;
> > }
> > }
> > ($password, $cypher) = &mkpass;
> > print OUT "$fn $ln => $username $password\n";
> > print "creating user $username\n";
> > `/usr/sbin/adduser -p $cypher $username`;
> > `/usr/bin/smbpasswd -a $username $password`;
> > $seen{$username}=1;
> >}
> >
> >sub mkpass {
> > $pass = "";
> > $vstr=("aeiou");
> > $cstr=("bcdfghjkmnprstvwxz");
> > $Cstr=("bcdfghjkmnprstvwxz");
> >
> > for($i=1;$i<=6;$i++){
> >
> >$pass.=substr($Cstr,(int(rand(18))+1),1);
> > $i++;
> > $pass.=substr($vstr,(int(rand(4))+1),1);
> > $i++;
> >
> >$pass.=substr($cstr,(int(rand(17))+1),1);
> > }
> > chop $pass;
> > $salt=substr($cstr,(int(rand(17))+1),2);
> > $cypher=crypt($pass,$salt);
> > @passwords=($pass,$cypher);
> > return @passwords
> >}
> >
> >Thank you for all of your help, it has really helped
> >me in setting up my 5 LTSP servers and serving an
> >entire high school.
> >
> >Jennifer
> >
> >__________________________________________________
> >Do you Yahoo!?
> >Yahoo! Tax Center - File online, calculators, forms, and more
> >http://tax.yahoo.com
> >
> >
> >
> >_______________________________________________
> >K12OSN mailing list
> >K12OSN redhat com
> >https://listman.redhat.com/mailman/listinfo/k12osn
> >For more info see <http://www.k12os.org>
> >
> >
> >
> >
> >
>
>
>
>
> _______________________________________________
> K12OSN mailing list
> K12OSN redhat com
> https://listman.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>
>
>
>
> _______________________________________________
> K12OSN mailing list
> K12OSN redhat com
> https://listman.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]