Directory tools for Edubuntu server
David Groos
djgroos at gmail.com
Thu Jun 18 04:18:58 BST 2009
Nice--2 solutions for adding/removing users--and a friend wrote one for me
as well makes 3. Is there an online space where these 'local solutions'
could be placed and possibly developed? Or at least they could each be
given their own page on the ubuntu/edubuntu wiki. If I had known about
other people's work I wouldn't have bothered this friend with creating a new
one. What do you-all think? Should we add a few pages to the edubuntu
wiki?
About the comparison between CLI and GUI, all I've got to say is that 'one
man's meat is another man's poison'. While both CLI and GUI have their
non-overlapping strengths, preference is not only based on the tool (and the
task) but also in the hand that wields the tool. While there's a certain
joy for me in effectively using CLI, my hand *likes* GUI. :-)
David
On Wed, Jun 17, 2009 at 11:20 AM, Gerald Drouillard <gerrylist at drouillard.ca
> wrote:
> On 6/17/2009 12:01 PM, Andy Figueroa wrote:
> > I love good gui tools for managing users, but they are tedious and time
> > consuming for making many changes, additions, or deletions.
> >
> > Depending on what user and group items are being managed, the most
> powerful
> > tool for changing group permissions for established users is directly
> > editing the /etc/group file as root using a text editor.
> >
> > Likewise, adding and deleting users is most expediently done by the
> > administrator as root from the command line. For adding many users at a
> > time, a little shell script like that below makes my day. This is an
> actual
> > except from the script that I use:
> >
> Here is the one I use that seems a little easier....IMO:
>
> #!/bin/bash
> #list all users...
> #cut -d: -f1 /etc/passwd
> #space delimited file of users separated by line returns
> #groupadd student
>
> toLower() {
> echo $1 | tr "[:upper:]" "[:lower:]"
> }
> toUpper() {
> echo $1 | tr "[:lower:]" "[:upper:]"
> }
> logIt() {
> echo $1
> echo $1 >>log.txt
> }
> rm log.txt
> unixfile=unix_user_list.txt
> #Remove any CRLF's
> tr -d "\015" < students.txt > $unixfile
> cat $unixfile | \
> while read FIRSTNAME MIDDLE LASTNAME PASSWORD
> do
> username=`toLower ${FIRSTNAME}.${LASTNAME}`
> egrep "^$username" /etc/passwd >/dev/null
> if [ $? -eq 0 ]; then
> logIt "Exists: $username"
> else
> homedir=/home/student/$username
> xpass=`mkpasswd $PASSWORD`
> # echo $username $PASSWORD $xpass
> useradd -f 360 -d $homedir -c "$FIRSTNAME $MIDDLE $LASTNAME" -m
> -s /bin/bash -g student -G
> dialout,cdrom,floppy,audio,dip,plugdev,scanner -p $xpass "$username"
> if [ $? -eq 0 ]; then
> chmod 700 $homedir
> logIt "Added: $username $PASSWORD"
> else
> logIt "Error $?: ${username}"
> fi
> fi
> done
> rm $unixfile
>
>
> --
> Regards
> --------------------------------------
> Gerald Drouillard
> Technology Architect
> Drouillard & Associates, Inc.
> http://www.Drouillard.biz
>
> --
> edubuntu-users mailing list
> edubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/edubuntu-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/edubuntu-users/attachments/20090617/88cad19d/attachment.htm
More information about the edubuntu-users
mailing list