Skip to end of metadata
Go to start of metadata

Class Creation Tool

Given a list of users and some details on the class/project, automatically create users, course directory, administration group, student-specific submission folders, and administration permissions. The tool is also useful for fixing permissions of existing course directories, simply omit the userlist flag and point the -d flag at the target directory.    

Professors must be added to the profs group to grant them sudo permissions for this command. Please submit a helpdesk ticket to be added. 

[-u userlist.txt]      | File containing list of AD usernames of class members, separated by newline. will be stripped. Omit to simply apply permissions or skip subdirectory creation.
-p <professor>         | AD username of professor
-d <path to class>    | Full path to existing class dir, e.g. /data/class/cs141. Will be the parent directory for permissions and directory creation. Will be created if it does not exist.
[-s semester]          | Semester, format with s or f followed by two digit year - e.g., f21 or s22. Will be the subdirectory containing student folders, when omitted student folders will be created in the parent course directory.
-g <admin group>  | Group name for the course administration e.g., cs141-admin. Will be created if it does not exist.
[-t]                   | Prompt for adding additional accounts to the course admin group.
[-w] | Web mode - creates a public_html folder in the given course directory with proper permissions. Changes the behavior of the [-u userlist] and [-s semester] flags - makes public student folders within the webroot, optionally in a subdirectory thereof set by the semester flag.

ssh into polaris and run the following:

sudo class_init [-u userlist file] -d <path to class dir> [-s semester] -g <class admin group> -p <professor username> [-t] [-w]

sudo class_init -u ./tocreate_cs141.txt -d /data/class/cs141/ -s f21 -g cs141-admin -p cthorpe -t

The above will:

  • create user accounts for all listed in the ./tocreate_cs141.txt file if they do not already exist
  • create a directory called f21 in /data/class/cs141/ owned by cthorpe
  • create a group called cs141-admin and add cthorpe to it
  • create a submission directory for each student, owned by the student and the cs141-admin, allowing access to only the particular student and members of the cs141-admin group
  • prompt you for TA names (whose accounts will be created if they do not already exist) and add them to the cs141-admin group

Note that the semester flag does not necessarily need to be a semester, it's simply the student submission subdirectory. You could create whatever structure you like with the two directory flags, they are only meant to give an idea of the average use case. You could provide /data/class/cs141/f21 as the -d flag, and pass students as the -s flag to create a /data/class/cs141/f21/students/<studentnames> structure. 

For setting up a course/project with a lin-web/ webpage, use the -w flag:

sudo class_init -u ./tocreate_cs675.txt -d /data/class/cs675/ -s 2021fa/f21 -g cs675-fa21-admin -p jmatthew -w

The above will:

  • create user accounts for all listed in the ./tocreate_cs675.txt file if they do not already exist
  • create a group called cs675-fa21-admin and add jmatthew to it
  • create a directory called 2021fa/f21 in /data/class/cs675/public_html owned by jmatthew:cs675-fa21-admin
  • create a webfolder subdirectory for each student in /data/class/cs675/public_html/2021fa/f21, owned by the student and the cs675-fa21-admin, allowing write access to only the particular student and members of the cs675-fa21-admin group
  • Make the course accessible at

  • No labels