Prev Up Next
Go backward to 4.15 Editor - vi
Go up to 4 Labs
Go forward to 4.17 Subdirectories

4.16 File Protection

File protection and file accessibility are important features that make time sharing systems usable. Keeping people from accessing files that they are not permitted to access while allowing un-restricted access to files that they are allowed to access is difficult to implement in practice. In this lab we will look at the UNIX approach to allowing and limiting access to files.
  1. Copy over a file to work with from the class area.
    $ copy class:heaven.txt *
    
  2. Use the SHOW PROTECTION command to show your default protection.
  3. Use the SET PROTECTION command to change the OWNER protection of the file HEAVEN.TXT to READ, WRITE, and EXECUTE (remove DELETE).

    Check it with the DIRECTORY/PROTECTION command.

     
    $ SET PROTECTION=OWNER:RWE HEAVEN.TXT
    
  4. Attempt to delete HEAVEN.TXT;0. If you changed the protection correctly, the delete will fail. You may need to use a different version number, other than zero.
  5. Change the protection of all .COM files to allow GROUP and WORLD users READ and EXECUTE access.

    Check the protection with the DIRECTORY/PROTECTION command.

    $ SET PROTECTION=(GROUP:RE,WORLD:RE) *.COM;*
    
  6. Use the following command to list the protections to the file PROTECT.LIS.
    DIRECTORY /PROTECTION /OUTPUT=PROTECT.LIS
    
  7. Undo part and change GROUP and WORLD access back to NONE.
     
    $ SET PROTECTION=(GROUP,WORLD) *.COM;*
    
Print and turn in a printed copy of the directory listing that you placed in the file PROTECT.LIS marked:
Your-Name
Lab 4.16: File Protections
TABER CSC135
Place the lab in the instructor hand-in box in BUS R6E, the "terminal room".
Instructor: ltaber@pima.edu** My new Home on phRed** The Pima College Site** The Mad Dr. G.'s home page on phred.

Prev Up Next