Assignment D

General instructions for all assignments

Provide an answer for each item in each session.
Number each answer with the same number as the corresponding item in the session assignment.
When the answer to the item is a Unix command, show the command and the system's response.
When the system prints more than 5 lines, abbreviate the response to 5 lines (unless more lines are specifically requested), showing the most important parts.
Use vi to create a file for each session, for example, create a file named sessionD1

Special instructions for assignment D

Working on assignment, you need to pair up with another student to do some of the lab work. They will need to read your files. You will need to read their files.

Session D1

  1. Log into the system.
  2. Check which group or groups you belong to.
  3. Use the umask command to allow default permissions to be 700 for newly created directories.
  4. Create a directory named directoryD in your home directory.
  5. While still in your home directory, check the permissions of your directoryD directory. Are they 700? If the permissions of the directoryD directory are not 700, delete it and start over and try again.
  6. While still in your home directory, create a directory under the directoryD directory and name it directoryD1
  7. While still in your home directory, check the permissions of your directoryD1 directory. Are they 700?
  8. Change to the directoryD1 directory.
  9. Create a file named commandsD1 in this directory. It should contain five lines of text, each containing the name and a very short description of the commands: umask chmod groups cd mv
  10. Print this file. (Remember that print in UNIX means print to the screen.)
  11. Check the permissions of the commandsD1 file. Are they 700 or 600? Why? Explain the difference between the initial permissions set for files and for directories.
  12. Are the users in your group allowed any access to this file? Are other users (outside of your group) allowed any access to this file?
  13. In the remainder of this session, work with another student. You will try to read their commandsD1 file; they will try to read your commandsD1 file.
  14. These attempts should fail. One of the reasons for the failures is because group members do not have read permission for the commandsD1 files.
  15. While still in directoryD1, change the file permissions to allow users in your group to read this file, but do not change the permissions for others.
  16. You and your partner should try again. It should still fail. Why?
  17. Is there a need to change the permissions of any directories? If yes, make the necessary change(s). (This response may total a maximum of 10 lines.)
  18. While still in directoryD1, use ls to verify the work done in the previous item.
  19. Your partner should copy this file into their directoryD1 with the new name of partner. Was the copy successful? If not, find the reason and take the appropriate action(s) to correct it. Then have your partner try again until you make it work.
  20. Copy their commandsD1 file to your directoryD1 with a new name of partner.
  21. You may log out, or continue with the following session.

Session D2

  1. Log into the system or change to your home directory.
  2. Change your default mask so that directories created in the future have permissions 664.
  3. Create a directory called temp in your home directory.
  4. Check the permissions of the temp directory. If the permissions of the temp directory are not 664, delete it and start over.
  5. Delete the temp directory.
  6. Create a directory called directoryD2 under the directoryD directory.
  7. Check the permissions of this directory.
  8. Try to change to the directoryD2 directory. You should have a problem. Make the necessary permission changes so that you can change to the directory.
  9. Now, change to the directoryD2 directory.
  10. Create a file named commandsD2 in this directory. It should contain five lines of text, each containing the name and a very short description of the commands: ls mkdir rm rmdir ln
  11. Print this file. (Remember that print in UNIX means print to the screen.)
  12. Check the permissions of directory directoryD2 and file commandsD2. Can users in your group copy this file? Can they change this file? Can they execute this file? Can users outside your group copy this file? Can they change this file? Can they execute this file?
  13. Change the permissions of directory directoryD2 and file commandsD2 so that every user can read, modify, but not execute this file.
  14. Check the permissions of directory directoryD2 and file commandsD2 and change the permissions if they are not correct.
  15. Log out of the system.

Submission session

Create a heading similar to the heading for assignment A.

Tommy Atkins   replace with your name
CIS 18A    
Winter 2011   replace with the current quarter
Assignment D  replace with the current assignment letter

  1. Use the following command to create a file with your work from the assignment:
    cat headingD sessionD1 sessionD2 > assignmentD.txt
  2. Use e-mail or WinSCP to obtain a copy of assignmentA.txt. Print it using notepad, or otherwise use the Courier New or other mono-space font.
  3. Turn in your printout to the instructor on time.