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
- Describe how the permissions of a file affect your
ability to:
- rename the file in the same directory
- move the file to another directory in your own account
- move the file to another directory in another file system, e.g. to
the /tmp/ directory
- delete the file
- Describe how the permissions of an empty sub-directory
affect your ability to:
- rename the empty sub-directory
- move the empty sub-directory to another directory in your own account
- move the empty sub-directory to another directory in another file
system, e.g. to the /tmp/ directory
- delete the empty sub-directory
- Describe how the permissions of a non-empty (containing at
least one file) sub-directory affect your ability to:
- rename the non-empty sub-directory
- move the non-empty sub-directory to another directory in your own
account
- move the non-empty sub-directory to another directory in another file
system, e.g. to the /tmp/ directory
- delete the non-empty sub-directory
|