Set 4
Home Up Introduction Set 1 Set 2 Set 3 Set 4 Set 5 Set 6 Set 7 Set 8 Set 9 Set 10 Set 11

 

File and Directory Permissions

Based on an assignment by Michael Anderson.

Security for UNIX systems is primarily achieved through the use of permissions on files and directories. It is important to thoroughly understand the effect of each permission, as it applies to both files and directories.

An objective of this lab is to experiment with permissions to gain an understanding of how they work. To complete this lab you will need to fill out the Part I chart and paragraph, below, and answer the Part II questions, below.

Part I - Directory Permissions

At the end of the lab, you should be able to write a paragraph (3-4 sentences) which succinctly, yet accurately describes the effect of directory permissions on the operation of various Unix commands on items within the directory. What are the overall conditions required to create, read, and delete items in/from a directory?

Steps:

Create a dummy or test directory.
Copy some dummy or test files into the test directory.
Use the chmod command to change permissions on the test directory as given in the chart, below.
Verify the effect of different test directory permissions by using the commands to copy, move, and delete files, as well as create, remove, and change directories (ie. cp, mv, rm, mkdir, rmdir, cd).
Fill out the chart based on what you learn.
Write a short paragraph summarizing what you learned.
Test
Directory
Permissions
simple ls ls -l cd into cp in/out mv in/out rm inside mkdir/rmdir inside
- - -              
r - -              
- w -              
- - x              
r w -              
r - x              
- w x              
r w x              

Remember to write that short, descriptive paragraph!

Part II - Permissions of Files and Directories

  1. Describe how the permissions of a file affect your ability to:
    1. rename the file in the same directory
    2. move the file to another directory in your own account
    3. move the file to another directory in another file system, e.g. to the /tmp/ directory
    4. delete the file
  2. Describe how the permissions of an empty sub-directory affect your ability to:
    1. rename the empty sub-directory
    2. move the empty sub-directory to another directory in your own account
    3. move the empty sub-directory to another directory in another file system, e.g. to the /tmp/ directory
    4. delete the empty sub-directory
  3. Describe how the permissions of a non-empty (containing at least one file) sub-directory affect your ability to:
    1. rename the non-empty sub-directory
    2. move the non-empty sub-directory to another directory in your own account
    3. move the non-empty sub-directory to another directory in another file system, e.g. to the /tmp/ directory
    4. delete the non-empty sub-directory