ManageGroups

Differences between revisions 5 and 6
Revision 5 as of 2008-11-24 01:37:02
Size: 2578
Editor: c-75-73-59-22
Comment:
Revision 6 as of 2009-01-19 16:37:14
Size: 3729
Editor: 75-168-232-204
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
'''Figure out how to set detailed preferences for groups of users:''' '''Figure out how to easily manage student's access to applications, printers and files:'''
Line 4: Line 4:
As a teacher one of our primary responsibilities is to manage student behavior. This is accomplished through everything we do, not only our curriculum and classroom activities, but also things like the physical layout of the classroom, what we have posted on the walls, the way we interact and feel about our students, as well as our limit setting procedures i.e. how we handle accountability to classroom rules. it is this last parameter that management software can support.
Line 6: Line 8:
 * Do something
  * some detail
 * Earning privileges
  * A normal way of bringing a person into a community is by giving them an initial set of limited privileges, and as the person shows themselves to be a responsible member of that community artificial limits are removed i.e. privileges increased. In the classroom this could take the form of managing group privileges:
   * Level 1 group allows a student to login to their account, explore the computer's possibilities in such a way that nothing can be damaged either out of ignorance nor malice. you it also allows for using a limited set of applications such as, Open Office and CmapTools running under local account, not using the Internet CmapServers

Figure out how to easily manage student's access to applications, printers and files:

Description: As a teacher one of our primary responsibilities is to manage student behavior. This is accomplished through everything we do, not only our curriculum and classroom activities, but also things like the physical layout of the classroom, what we have posted on the walls, the way we interact and feel about our students, as well as our limit setting procedures i.e. how we handle accountability to classroom rules. it is this last parameter that management software can support.

Procedure:

  • Earning privileges
    • A normal way of bringing a person into a community is by giving them an initial set of limited privileges, and as the person shows themselves to be a responsible member of that community artificial limits are removed i.e. privileges increased. In the classroom this could take the form of managing group privileges:
      • Level 1 group allows a student to login to their account, explore the computer's possibilities in such a way that nothing can be damaged either out of ignorance nor malice. you it also allows for using a limited set of applications such as, Open Office and CmapTools running under local account, not using the Internet CmapServers

  • Do something else
    • some detail

Comments:

v1

Script to Add users from a CSV File

  • #!/bin/bash # Script to add a user to Linux system FILENAME=Students.csv EXIST=Student.Exist

    >$EXIST debug=1 # Test input for a file name and verify it´s existance if [ -z $1 ]; then

    • echo Requires a filename to process exit
    else
    • if [ ! -f $1 ]; then
      • echo File ${FILENAME} does not exists exit
      fi
    # remove space characters from file from the file
    • cat $1 | sed 's/ //g' > $FILENAME

    fi #if [ $(id -u) -eq 1006 ]; then if [ $(id -u) -eq 0 ]; then
    • for d in cat ${FILENAME} do

      • # Get the students name in normal form, first letter capitalized

        n_ln=echo $d | cut -d, -f1 # Lowercase the name and cut out the first 2 characters

        ln2=echo ${n_ln} | tr [A-Z] [a-z] | cut -c 1-2 # Get the first name

        n_fn=echo ${d} | cut -d, -f2 # Lowercase the first name fn6=echo ${n_fn} | tr [A-Z] [a-z] | cut -c 1-6

        username=echo ${fn6}${ln2} period=echo ${d} | cut -d, -f3 password=echo ${d} | cut -d, -f4 if [ $debug -eq 0 ]; then

        • echo First Name $n_fn echo Last Name $n_ln echo Login Name $username echo Period $period echo Password $password echo
        fi if [ $debug -eq 1 ]; then
        • #read -p "Enter username : " username #read -p "Enter password : " password

          egrep "^period${period}" /etc/group >/dev/null if [ $? -ne 0 ]; then

          • echo "period$period does not exists!" echo "Creating group period${period}" groupadd period${period}
          fi

          egrep "^$username" /etc/passwd >/dev/null # if the user exist dump user name out to a file if [ $? -eq 0 ]; then

          • echo "Student $n_fn $n_ln already exists"

            echo "${n_ln},${n_fn},${period},${password}" >> $EXIST

          else
          • pass=$(perl -e 'print crypt($ARGV[0], "password")' $password) useradd -m -c "${n_fn} ${n_ln}" -g period${period} -p $pass $username

            [ $? -eq 0 ] && echo "User ${n_fn} ${n_ln} has been added to system!" || echo "Failed to add a user!"

          fi
        fi
      done
    else
    • echo "Only root may add a user to the system" exit 2
    fi rm $FILENAME

v2

To say the least, the script went though a complete re-write. It is now a menu driven process.

v3

m1

m2

m3

ManageGroups (last edited 2009-10-14 20:51:25 by 75-150-67-119-NewEngland)