6. Appendix: Protecting Your Files on the Unix System

The basic protection commands for Unix are covered in CS252. Here, however, I outline a simple setup that will make sure your files are protected from snooping without you're needing to worry about it every time you start a new assignment.

For the same of example, let's suppose that you are working on an assignment "asst1", with the instructor-provided files contained in the directory /home/cs382/Assignments/asst1.

  1. If this is your first assignment for the course, create a course work area and protect it from access by anyone except yourself.

    mkdir ~/cs382
    chmod 700 ~/cs382
  2. Create a working directory for this assignment:

    cd ~/cs382
    mkdir asst1 cd asst1

    You need not worry about protecting this directory, as it is inside a directory that only you can access.

  3. Copy any files you need into this directory. E.g.,

    cd asst1 
    cp /home/cs382/Assignments/asst1/* .

    It's important, by the way that you copy "*" and not "*.*". The latter will only copy files that have a '.' in their name. Many files do not. Most notably, the makefile I provide with most assignments does not.

    This cp command will not copy anything inside subdirectories of the assignment directory. Usually, that's OK because the only subdirectory is probably the bin directory where the sample solutions are kept, and you don't need a distinct copy of that.

  4. You are now ready to start work.

    For most assignments, you can compile the code by just giving the command

    make

In future assignments, just make it a habit to do all of your assignments inside the protected ~/cs382 directory, and you won't have to worry about anyone else seeing your code.


In the Forum:

(no threads at this time)