umask
Updated: 2015-11-12 13:59 EST
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.
10h00 (10am) Monday November 16, 2015 (start of Week 11)
WARNING: Some inattentive students upload Assignment #08 into the Assignment #07 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.
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.
All references to the Source Directory below are to the CLS directory ~idallen/cst8207/15f/assignment08/
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.
You must keep a list of command names used each week and write down what each command does, as described in the List of Commands You Should Know. Without that list to remind you what command names to use, you will find assignments very difficult.
Do a Remote Login to the Course Linux Server (CLS) from any existing computer, using the host name appropriate for whether you are on-campus or off-campus. All work in this assignment must be done on the CLS.
Make the CLS directory ~/CST8207-15F/Assignments/assignment08
in which you will create the files and scripts resulting from the following tasks. (You do not have to create any directories that you have already created in a previous assignment.) Spelling and capitalization must be exactly as shown:
check
check
symbolic link needed to run the Checking Program, as you did in your last assignment and as described in the section Checking Program below.This assignment08
directory is called the Base Directory for most pathnames in this assignment. Store your files and answers in this Base Directory, not in your HOME directory or anywhere else.
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.
abcd0001.txt
Copy the file record.txt
from the Source Directory into your own file abcd0001
.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. Read the file to know what to do with it.
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 VI Text Editor is recommended, since that is the universal text editor for system administrators.) Replace each string of three underscore characters “_
” in the file with the correct three-digit numeric (octal) permission value that you record in the next Part below.
Enter your userid into the file in the indicated place.
Be careful not to make other accidental changes to 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.
You need to understand Permissions for this task. Do the permissions section of Lab Worksheet #08 ODT before continuing. Record all your answers for later quizzes.
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-
root
user, 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.
head
head
under your Base Directory:
head
has no permissions for others. The group can use ls
to see the content, but cannot create files or cd
into the directory. The user has full permissions. Record the permissions for head
in the Record file.head
create three three-letter directories named: usr grp oth
usr
has no permissions for group or other. The user can cd
into it, but cannot create any new content nor use ls
to see any files in it. Record the permissions.grp
has no permissions for user or other. The group can cd
into it and use ls
in it, but cannot create any new content. Record the permissions.oth
has no permissions for user or group. Others have full permissions. Record the permissions.usr
create three two-letter files named: rd wr xc
rd
has read permission (only) for the user. Record the permissions.wr
has write permission (only) for the user. Record the permissions.xc
has execute permission (only) for the user. Record the permissions.grp
create three two-letter files named: rw wx rx
rw
has read and write permission (only) for the group. Record the permissions.wx
has write and execute permission (only) for the group. Record the permissions.rx
has read and execute permission (only) for the group. Record the permissions.oth
create 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.)
rwx
has 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.
You need to understand Permissions for this task. Do the permissions section of Lab Worksheet #08 ODT before continuing. Record all your answers for later quizzes.
minimal.txt
Copy the file minimal.txt
from the Source Directory into your Base Directory. Read the file to know what to do with it.
Fix the permissions on the file so that you can edit it and nobody else (group or other) has any permissions at all.
Edit the file and replace all the sets of three underscore characters “_
” in the file 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.
Enter your userid into the file in the indicated place.
Be careful not to make other accidental changes to 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.
rwx
permissions.Run the Checking Program to verify your work so far.
umask
to mask default permissionsIndexYou need to understand Umask for this task. Do the umask
section of Lab Worksheet #08 ODT before continuing. Record all your answers for later quizzes.
umask.txt
Copy the file umask.txt
from the Source Directory into your Base Directory. Read the file to know what to do with it.
Fix the permissions on the file so that you can edit it and nobody else (group or other) has any permissions at all.
Edit the file and replace the three underscore characters “_
” 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.)
Enter your userid into the file in the indicated place.
Be careful not to make other accidental changes to 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.
umask
set incorrectly after this exercise.Run the Checking Program to verify your work so far.
That is all the tasks you need to do.
Check your work a final time using the Checking Program below and save the standard output of that program into a file as described below. Submit that file (and only that one file) to Blackboard following the directions below.
When you are done, log out of the CLS before you close your laptop or close the PuTTY window, by using the shell exit
command:
$ exit
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 single file that is the output of the Checking Program 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.
check
There is a Checking Program named assignment08check
in the Source Directory on the CLS. You can execute this program by typing its (long) pathname into the shell as a command name:
$ ~idallen/cst8207/15f/assignment08/assignment08check
Create a symbolic link named check
in your Base Directory that links to the Checking Program in the Source Directory, as you did in the previous assignment.
Execute the above Checking Program as a command line on the CLS. This program will check your work, assign you a mark, and display the output on your screen.
You may run the Checking Program as many times as you wish, allowing you 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.
When you are done with this assignment, and you like the mark displayed on your screen by the Checking Program, you must redirect only the standard output of the Checking Program into the text file assignment08.txt
in your Base Directory on the CLS, like this:
$ ./check >assignment08.txt
$ less assignment08.txt
assignment08.txt
file name.YOUR MARK for
assignment08.txt
(containing the output from the Checking Program) from the CLS to your local computer.
YOUR MARK for
assignment08.txt
file 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 assignment08 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!