This assignment is due Tuesday, February 24 at the beginning of class. Assignments must be stapled. Written homework must be turned in at the beginning of the class period to be considered on time. Print programs using non-proportional type (e.g., Courier) in at least 10 point size. You may use proportional type for answers to questions, but make sure the type size is at least as large as what you are reading (i.e., 12 point). This means that you may not print 2-up. Homework should be turned in on 8 1/2 x 11 paper and must be stapled together. The upper right corner of the first page should contain (a) your name, (b) CS330, (c) the assignment number, (d) the date. If you cannot attend class, written assignments will be considered on time if they are left under my office door provided they are received before class time.

Login to turing.cs.niu.edu or hopper.cs.niu.edu to perform the assigned tasks. Use the "script" utility (see "man script") to record your work in a transcript file. You may edit your transcript files later to include your answers to some of the questions mentioned. Make sure each part (A1, A2, etc.) is labeled on the transcript. Make sure you answer every question, i.e., don't leave it to the TA to figure it out. Most "why or why not" questions should be answered with reference to the permissions.

Part A. Permissions

A1: At a current working directory, start a transcript file, named "A2-PartA".
A2: Display the full pathname of your current working directory.
A3: Create a directory named "udir" in your home directory.
A4: Make sure the directory "udir" has read, write, and execute permissions for the owner.
A5: List the permissions for the "udir" directory.
A6: Make "udir" your current directory.
A7: Display the full pathname of your current working directory.
A8: In the directory "udir", execute the following commands to create two text files, named "file1" and "file2".
echo "Line A of file1 file" > file1
echo "Line A of file2 file" > file2
A10: Display the permissions for "file1" and "file2".
A11: Move to the immediate parent directory of the "udir" directory and answer these questions:

  1. Can you make "udir" your current directory (i.e. cd to it)? Why or why not?
  2. Can you list the contents of the "udir" directory? Why or why not?
  3. Can you view the contents of the "file1" file? Why or why not?
  4. Can you copy the "file2" file to a different directory? Why or why not?
  5. Can you rename the "file1" file to "file1.old"? Why or why not?
  6. Can you remove (i.e. delete) a file from the directory? Why or why not?
  7. Can you hard link to the "file2" file? Why or why not?

A12: Change the permissions of the directory "udir" so that it has only READ and WRITE permissions.
A13: Move to the immediate parent directory of the "udir" directory and answer these questions:

  1. Can you make "udir" your current directory (i.e. cd to it)? Why or why not?
  2. Can you list the contents of the "udir" directory? Why or why not?
  3. Can you view the contents of the "file1" file? Why or why not?
  4. Can you copy the "file2" file to a different directory? Why or why not?
  5. Can you rename the "file1" file to "file1.old"? Why or why not?
  6. Can you remove (i.e. delete) a file from the directory? Why or why not?
  7. Can you hard link to the "file2" file? Why or why not?

A14: Close your transcript file.

Part B. User mask

B1: Start a transcript file, named "A2-PartB".
B2: Use the command named "groups" to check which group or groups you
belong to. Can an ordinary user belong to more than one group?
B3: Check your default permission mask. Explain the meaning of the mask that you have.
B4: Create three directories called "current-assign", "data", and "submit-assign".
B5. List the permissions on the three directories you just created.
B6: Using octal mode, set the permissions for the "data" directory so that
you have all three permissions (rwx), users in your group have read
access only, and the other users of the system have no access
permissions.
B7: List the permissions on the directory "data" to confirm the permission change.
B8: Using symbolic mode, issue the command to give others only xecute permission to the "data" directory.
B9. List the permissions on the directory "data" to confirm that others have execute permission to the directory.
B10: Change the default permission mask to 066. Explain the meaning of the mask.
B11: What are the default permissions for all directories created after step B10?
B12: What are the default permissions for all files created after step B10?
B18: Close your transcript file.