Updated: 2015-03-17 13:47 EDT
Do not print this assignment on paper!
- On paper, you will miss updates, corrections, and hints added to the online version.
- On paper, you cannot follow any of the hyperlink URLs that lead you to hints and course notes relevant to answering a question.
- On paper, scrolling text boxes will be cut off and not print properly.
12h00 (noon) Monday November 10, 2014 (start of Week 11)
WARNING: Some inattentive students upload Assignment #7 into the Assignment #6 upload area. Don’t make that mistake! Be exact.
Do not print this assignment on paper! On paper, you cannot follow any of the hyperlink URLs that lead you to hints and course notes relevant to answering a question.
This assignment is based on your weekly Class Notes.
Remember to READ ALL THE WORDS to work effectively and not waste time.
This is an overview of how you are expected to complete this assignment. Read all the words before you start working.
For full marks, follow these directions exactly.
You will create file system structure in your CLS home directory containing various directories and files. You can use the Checking Program to check your work as you do the tasks. You can check your work with the checking program as often as you like before you submit your final mark. Some task sections below require you to finish the whole section before running the checking program; you may not always be able to run the checking program successfully after every single task step.
When you are finished the tasks, leave these files and directories in place on the CLS as part of your deliverables. Do not delete any assignment work from the CLS until after the term is over!
Assignments may be re-marked at any time on the CLS; you must have your term work available on the CLS right until term end.
All references to the “Source Directory” below are to the CLS directory
~idallen/cst8207/14f/assignment07/ and that name starts with a tilde character
~ followed by a user name with no intervening slash. The leading tilde indicates to the shell that the pathname starts with the HOME directory of the account
idallen (seven letters).
You do not have permission to list the names of all the files in the Source Directory, but you can access any files whose names you already know.
All course notes are available on the Internet and also on the CLS. You can learn about how to read and search these CLS files using the command line on the CLS under the heading Copies of the CST8207 course notes near the bottom of the page Course Linux Server.
Make the CLS directory
~/CST8207-14F/Assignments/assignment07, in which you will create the files and scripts resulting from the following tasks.
check symbolic link needed to run the Checking Program, as described in the section Checking Program below.
assignment07directory is the Base Directory for most pathnames in this assignment. Store your files and answers in this Base Directory.
Use the symbolic link to run the Checking Program to verify your work so far.
You need to understand Permissions for this task.
You will need to record the permissions you set on each of the directories and files you create in the next Part, below. You will record these permissions by copying and editing a file that you get from your instructor. You can record each of the permissions as you create things step-by-step below, or you can record all of the permissions after you have finished, before you run the checking program.
Copy the file
record.txt from the Source Directory into your own file
.txt (no spaces) where the text
abcd0001 is replaced by your own eight-character userid in the file name. This file copy should be located directly under your Base Directory.
Fix the permissions on the file so that you can edit it and nobody else (group or other) has any permissions at all.
As you work on the next Part below, edit your copy of the file with a text editor. (The
vim editor is recommended, since that is the universal text editor for system administrators.) Replace each string of three underscores in the file with the correct three-digit numeric (octal) permission value that you record in the next Part below. Do not change anything else in the file. Note the word count at the bottom of the file. Your count must match exactly, at all times. If not, re-copy the file and start over.
Now you will create some directories and files, then set the correct permissions on them. The permissions to set are described below.
Because you are applying permissions to directories as a non-
rootuser, be careful not to lock yourself out of directories by restricting permissions on them too soon. First, create all the file and directory structure from the top of the directory tree down, and then apply restrictive permissions afterward from the bottom of the tree upward, after you have created all the structure.
If you don’t apply permissions last, from the bottom up, you will deny yourself permissions that will prevent you from entering some directories lower down. Assign permissions from the bottom toward the top.
Make sure you create directories where directories are required and files where files are required.
headunder your Base Directory:
headhas no permissions for others. The group can use
lsto see the content, but cannot create files or
cdinto the directory. The user has full permissions. Record the permissions for
headin the Record file.
headcreate three three-letter directories named:
usr grp oth
usrhas no permissions for group or other. The user can
cdinto it, but cannot create any new content nor use
lsto see any files in it. Record the permissions.
grphas no permissions for user or other. The group can
cdinto it and use
lsin it, but cannot create any new content. Record the permissions.
othhas no permissions for user or group. Others have full permissions. Record the permissions.
usrcreate three two-letter files named:
rd wr xc
rdhas read permission (only) for the user. Record the permissions.
wrhas write permission (only) for the user. Record the permissions.
xchas execute permission (only) for the user. Record the permissions.
grpcreate three two-letter files named:
rw wx rx
rwhas read and write permission (only) for the group. Record the permissions.
wxhas write and execute permission (only) for the group. Record the permissions.
rxhas read and execute permission (only) for the group. Record the permissions.
othcreate three three-character files named:
rwx ??? ***(Some characters are meta-characters that are special to the shell and will need careful handling. See the Class Notes about Quoting.)
rwxhas full permissions for other. Record the permissions.
???has no permissions for other. Record the permissions.
***has only read permission for other. Record the permissions.
Remember to read all the words above about working from top to bottom and then from bottom to top in this Part.
Run the Checking Program to verify your work so far.
Copy the text below into file
minimal.txt and replace all the sets of three underscore characters using your answers from Worksheet #08. Missing permissions should be given as dashes so that each set of three underscores is replaced with exactly three other characters:
*** Table of MINIMUM rwx symbolic permissions *** 1. copy a file: srcdir=___ srcfile=___ targetdir=___ 2. move a file: srcdir=___ srcfile=___ targetdir=___ 3. link to a file: srcdir=___ srcfile=___ targetdir=___ 4. delete a file: srcdir=___ srcfile=___ 5. read a file: srcdir=___ srcfile=___ 6. modify an existing file: dir=___ oldfile=___ 7. create a new file: dir=___
Run the Checking Program to verify your work so far.
Use a text editor to create and edit the file
umask.txt in your Base Directory. The file should contain this content:
1. drwxrwxrwx is created with a umask 0___ 2. drwxrwxr-x is created with a umask 0___ 3. drwxr-xr-x is created with a umask 0___ 4. drwxr-xr-- is created with a umask 0___ 5. drwxr-x--- is created with a umask 0___ 6. drwxr----- is created with a umask 0___ 7. drwx------ is created with a umask 0___ 8. d--x------ is created with a umask 0___ 9. d--------- is created with a umask 0___
The file must have a word count of:
9 72 387 umask.txt You can get a copy of the file from the Source Directory.
Edit the file and replace the three underscores
___ with the correct three-digit
umask value that would result in each set of symbolic permissions for a new directory. (Check your work by setting your
umask to the above value and then creating and examining the permissions of a new directory.)
The finished file must have the exact above word count. All correct answers will give a file checksum of
Do not leave your
umask set incorrectly after this exercise.
Run the Checking Program to verify your work so far.
Summary: Do some tasks, then run the checking program to verify your work as you go. You can run the checking program as often as you want. When you have the best mark, upload the marks file to Blackboard.
Since I also do manual marking of student assignments, your final mark may not be the same as the mark submitted using the current version of the Checking Program. I do not guarantee that any version of the Checking Program will find all the errors in your work. Complete your assignments according to the specifications, not according to the incomplete set of the mistakes detected by the Checking Program.
There is a Checking Program named
assignment07check in the Source Directory on the CLS. Create a Symbolic Link to this program named
check under your new Base Directory on the CLS so that you can easily run the program to check your work and assign your work a mark on the CLS. Note: You can create a symbolic link to this executable program but you do not have permission to read or copy the program file.
Execute the above
check program on the CLS using its symbolic link. (Review the Search Path notes if you forget how to run a program by pathname from the command line.) This program will check your work, assign you a mark, and display the output on your screen. (You may want to paginate the long output so you can read all of it.)
You may run the
check program as many times as you wish, to correct mistakes and get the best mark. Some task sections require you to finish the whole section before running the checking program at the end; you may not always be able to run the checking program successfully after every single task step.
assignment07.txtunder your Base Directory on the CLS. Use that exact name. Case (upper/lower case letters) matters. Be absolutely accurate, as if your marks depended on it.
YOUR MARK for
assignment07.txtfile from the CLS to your local computer and verify that the file still contains all the output from the checking program. Do not edit this file! No empty files, please! Edited or damaged files will not be marked. You may want to refer to your File Transfer notes.
YOUR MARK for
assignment07.txtfile from your local computer to the correct Assignment area on Blackboard (with the exact name) before the due date:
Use only Attach File on the Upload Assignment page. Do not enter any text into the Text Submission or Comments boxes on Blackboard; I do not read them. Use only the Attach File section followed by the Submit button. If you need to comment on any assignment submission, send me EMail.
You can revise and upload the file more than once using the Start New button on the Review Submission History page to open a new Upload Assignment page. I only look at the most recent submission.
You must upload the file with the correct name from your local computer; you cannot correct the name as you upload it to Blackboard.
You will also see the Review Submission History page any time you already have an assignment attempt uploaded and you click on the underlined assignment07 link. You can use the Start New button on this page to re-upload your assignment as many times as you like.
You cannot delete an assignment attempt, but you can always upload a new version. I only mark the latest version.
Your instructor may also mark files in your directory in your CLS account after the due date. Leave everything there on the CLS. Do not delete any assignment work from the CLS until after the term is over!
I do not accept any assignment submissions by EMail. Use only the Blackboard Attach File. No word processor documents. Plain Text only.
Use the exact file name given above. Upload only one single file of Linux-format plain text, not HTML, not RTF, not MSWord. No fonts, no word-processing. Linux plain text only.
NO EMAIL, WORD PROCESSOR, PDF, RTF, or HTML DOCUMENTS ACCEPTED.
No marks are awarded for submitting under the wrong assignment number or for using the wrong file name. Use the exact 16-character, lower-case name given above.
WARNING: Some inattentive students don’t read all these words. Don’t make that mistake! Be exact.
READ ALL THE WORDS. OH PLEASE, PLEASE, PLEASE READ ALL THE WORDS!
Author: | Todd Kelley, and | Ian! D. Allen - firstname.lastname@example.org - Ottawa, Ontario, Canada | Home Page: http://idallen.com/ Contact Improv: http://contactimprov.ca/ | College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/ | Defend digital freedom: http://eff.org/ and have fun: http://fools.ca/
Author Ian! D. Allen