[K12OSN] HELP!! creating bulk users

Randall Swift swift at msad52.org
Fri Aug 24 00:46:32 UTC 2007


Unfortunately, I do not understand your commands. I also have to have a
way to do this that will work as this is a production server. I would just
blow this away and start over but the users passwords have already been
put into there schedule. I am also unsure if I create the users again
using the bulk user script (from matt oquists smbldap-installer) that it
will still not create the home directories. Is there something wrong with
this script? I need help!

"Support list for open source software in schools." <k12osn at redhat.com>
writes:
>ahhh you need one of those lovely 'awk/sed' scripts that Les pimps out..
>
>that parses your /etc/passwd file and strips out the username and group 
>and does a
>mkdir -p /home/<username>
>then does a
>chown -R <username>:<group>
>then does a
>chmod 700 /home/*
>
>if only scripting were as easy as english!
>
>--Huck
>p.s. maybe this old gem I have tucked away in my archives will be of 
>assistance...
>
>[quote]
>
>Assuming all teacher names end in two digits and none of the students
>account names do this one liner may work:
>
>for teach in `cat /etc/passwd | awk '{FS=":";}{print $1}' | \
>egrep "[0-9][0-9]" ` ; do dir=/var/www/html/${teach}; mkdir $dir;\
>chmod 775 $dir ; cd /home/${teach}; ln -s $dir ${teach}.html; done
>
>not tested or debugged, use at own risk, beware of gnats etc..
>[/quote]
>
>_______________________________________________
>K12OSN mailing list
>K12OSN at redhat.com
>https://www.redhat.com/mailman/listinfo/k12osn
>For more info see <http://www.k12os.org>



Randy Swift
Network Administrator
Leavitt Area High School
Turner, Maine 04282
(207)225-3533
swift at msad52.k12.me.us




More information about the K12OSN mailing list