Permissions
Home Up Unix Notes Why Shell? Using Telnet Telnet Logging File Nodes Permissions Locked Out Internet Basics Unix Resources Real-World Unix
Updated:
2001-05-14 08:48

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:

  1. Create a new directory named test (or pick another name).
  2. Copy some dummy files into the test directory.   Make some dummy sub-directories.  Make sure that the dummy files and sub-directories you create have appropriate read/write/execute permissions for you, so that their permissions do not affect your test results.
  3. Use the chmod command to change permissions on the test directory as given in the chart, below.
  4. Verify the effect of different test directory permissions by using the given Unix commands to operate on files and sub-directories inside the test directory.  All of the Unix commands below start with the current working directory being the parent of the test directory.
  5. Fill out the chart based on what you learn.  If an operation is not permitted, record this fact.
  6. Write a short paragraph summarizing what you learned.
test
Directory
Perms.
ls test ls -l test cd test cp file test/file cp test/file file mv file test/file mv test/file file rm test/file mkdir test/dir rmdir test/dir
- - -                    
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
 

Web Author: Ian! D. Allen idallen@idallen.ca      Updated: 2001-05-14 08:48

Internet Free Zone Level 1 logo Support free and non-commercial Internet.

Any Browser logo This site works best in Any Browser, a campaign for non-specific WWW.

Creative Commons License logo This work is licensed under a Creative Commons License.