umask
Updated: 2017-05-31 12:15 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.
08h00 (08:00am) Monday November 18, 2013 (start of Week 12)
WARNING: Some inattentive students upload Assignment #9 into the Assignment #8 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.
Create directory and file structure with the given Permissions. Record the numeric (octal) permissions of each of the directories and files you create in the given record file.
Using various Umask settings, create new directories that have a given set of symbolic permissions.
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.
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/13f/assignment09/
and that name starts with a tilde character ~
followed by a userid 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).
Create the following directory structure in your CLS HOME directory and record (for study purposes) the series of Unix commands you used to create it. Spelling and capitalization must be exactly as shown:
CST8207-13F
`-- Assignments
`-- assignment09
This directory is the base directory for most pathnames in this assignment. Store your scripts and answers here.
There is a Checking Program named assignment09check
in the Source Directory on the CLS. Follow the instructions in the first two steps at the start of Checking Program to create a working symbolic link to this program.
Run the Checking Program to verify your work so far.
You 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 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 assignment09
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.
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.
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.
head
under assignment09
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
(You did create files, right?)
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.
umask
IndexUse a text editor to create and edit the file umask.txt
with this content:
1. drwxrwxrwx is created with umask 0___
2. drwxrwxr-x is created with umask 0___
3. drwxr-xr-x is created with umask 0___
4. drwxr-xr-- is created with umask 0___
5. drwxr-x--- is created with umask 0___
6. drwxr----- is created with umask 0___
7. drwx------ is created with umask 0___
8. d--x------ is created with umask 0___
9. d--------- is created with umask 0___
The file must have a word count of: 9 63 369 umask.txt
Edit the file and replace the three underscores ___
with the correct umask
value that would result in each set of symbolic permissions for a new directory. (Check your work by setting your umask
and then creating and examining a directory.)
The finished file must have a word count of: 9 63 369 umask.txt
All correct answers will give a file checksum of 15430
.
Do not leave your umask
set incorrectly after this exercise.
That is all the tasks you need to do.
Check your work a final time using the Checking Program and save the output as described below. Submit your mark following the directions below.
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.
There is a Checking Program named assignment09check
in the Source Directory on the CLS. Create a Symbolic Link to this program named check
under your new assignment09
directory so that you can easily run the program to check your work and assign your work a mark. 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 using its new 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.
When you are done with checking this assignment, and you like what you see on your screen, redirect the output of the Checking Program into the text file assignment09.txt
under your assignment09
directory on the CLS. Use the exact name assignment09.txt
in your assignment09
directory. Case (upper/lower case letters) matters. Be absolutely accurate, as if your marks depended on it. Do not edit the file. Make sure the file actually contains the output of the checking program!
Transfer the above assignment09.txt
file 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.
Submit the assignment09.txt
file under the correct Assignment area on Blackboard (with the exact name) before the due date. Upload the file via the assignment09 “Upload Assignment” facility in Blackboard: click on the underlined assignment09 link in Blackboard. Use “Attach File” and “Submit” to upload your plain text file.
No word-processor documents. Do not send email. Use only “Attach File”. Do not enter any text into the Submission or Comments boxes on Blackboard; I do not read them. Use only the “Attach File” section followed by the Submit button. (If you want to send me comments about your assignment, use email.)
Your instructor may also mark the assignment09
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!
Use the exact file name given above. Upload only one single file of plain text, not HTML, not MSWord. No fonts, no word-processing. Plain text only.
Did I mention that the format is plain text (suitable for VIM/Nano/Pico/Gedit or Notepad)?
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 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!