AIST3720 TechPrac05 Specs

  1. 25 pts - Operating Systems Q&A V

    Visit this course in D2L and complete Quiz05 by the due date / time for this assignment.

  2. (25 pts) MIME types & web downloads

    Ref: (Video) MIME types & web downloads on Linux Server / Apache

    Ref: (Video) MIME types & web downloads on Windows Server / IIS

    Begin a Word document MIME.docx which will contain screen caps as identified in the instructions below.

    1. Linux version

      TP05.II.A Errata: In TP04.II where we set up Basic Authentication in Linux for the BASite directory, changes we made in the apache2.conf configuration file also required that web directories contain a .htaccess file to control authentication for the directory. To avoid a 403 Forbidden error accessing your root web directory (i.e., /var/www/html accessed via http as http://localhost) you will need to add the following .htaccess file in the root folder which says any access is allowed. Before beginning TP05.II.A use
      sudo nano /var/www/html/.htaccess
      from a terminal and enter / save the following lines:
      AuthType None
      Require all granted

      In your local VMware Linux VM create the following files in the /var/www/html folder (default location for internet files); note that you may need sudo authority to create / place files in this folder:

      1. a text file named noext with content this file has no extension
      2. an exe file putty.exe which can be downloaded from here
      3. a text file named prevent.this with content this file should not download
      4. a PowerShell file named tstscript.ps1 with content # A PowerShell file

      Work with MIME types and .htaccess as necessary so that

      1. files with no extension download as text appearing in the browser when requested, adding a screen cap of visiting http://localhost/noext to your document;
      2. files with an .exe extension are recognized as (Windows) executable files offering to be downloaded, adding a screen cap of visiting http://localhost/putty.exe to your document;
      3. files with a .this extension do not download (despite the file being available on the web site), adding a screen cap of visiting http://localhost/prevent.this to your document; Note: I could not get this to work using .htaccess but changing /etc/apache2/apache2.conf [example] did
      4. files with a .ps1 extension are recognized as PowerShell script files offering to be downloaded, adding a screen cap of visiting http://localhost/tstscript.ps1 to your document.
    2. Windows version

      In your local VMware Windows Server VM recreate the setting from Linux version but in C:\inetpub\wwwroot (you may need admin authority to save / put files in this folder). Adjust settings so the same download behaviors occur. Make a similar set of four screen caps which you add to your document.

    Attach your completed MIME.docx (it should have 8 screen caps, 4 from Linux, 4 from Windows) to this assignment in D2L.

  3. (25 pts) Establish Linux directory and access control structure

    Ref: (Video) Video

    Ref: (Notes) Linux file and directory access control

    1. In your local xxxxLS1 VM create four users with names Alfa User, Bravo User, Charley User, and Delta User with logins auser, buser, cuser, and duser.
    2. Logged in administrator on your VM with your Documents as current working directory create directories named AlphaDir, BetaDir, and GammaDir. Each folder should contain two text files named FileA.txt and FileB.txt each with some content you create.
    3. Establish file access permissions on these sub-directories and files so that:
      • your admin login (as owner) has read, write, execute permission on all directories and files:
      • 'other' users (i.e., not listed in requirements below) have rwx permission for AlphaDir and its files, r-x permission for BetaDir and its files, and cannot access GammaDir or its files;
      • auser and buser can rwx GammaDir and all its files;
      • auser and cuser cannot access AlphaDir nor any of its files.

      Hint: Create a group with auser and buser, set this as the owner group for GammaDir and its files with appropriate group permissions. Similarly for auser, cuser, and AlphaDir.

    4. When permissions have been set and tested, use a terminal window with your admin account making your Documents the current working directory. Execute the commands
      date > ./LinPerms.txt
      whoami >> ./LinPerms.txt
      hostname >> ./LinPerms.txt
      ls -l >> ./LinPerms.txt
      ls -l AlphaDir >> ./LinPerms.txt
      G=$(stat -c "%G" AlphaDir) >> ./LinPerms.txt
      getent group $G >> ./LinPerms.txt
      ls -l BetaDir >> ./LinPerms.txt
      G=$(stat -c "%G" BetaDir) >> ./LinPerms.txt
      getent group $G >> ./LinPerms.txt
      ls -l GammaDir >> ./LinPerms.txt
      G=$(stat -c "%G" GammaDir) >> ./LinPerms.txt
      getent group $G >> ./LinPerms.txt
    5. Attach the resulting LinPerms.txt file to this assignment in D2L.

  4. (25 pts) Establish Windows directory and access control structure

    Ref: (Video) Windows groups and file permissions

    1. In your VMware Windows Server VM create four users with names Alfa User, Bravo User, Charley User, and Delta User with logins auser, buser, cuser, and duser.
    2. Logged in administrator on your VM with your Documents as current working directory create directories named AlphaDir, BetaDir, and GammaDir. Each folder should contain two text files named FileA.txt and FileB.txt each with some content you create.
    3. Establish file access permissions on these sub-directories and files so that:
      • your admin login has read, write, execute permission on all directories and files:
      • Users not listed in requirements below have rwx permission for AlphaDir and its files, r-x permission for BetaDir and its files, and cannot access GammaDir or its files;
      • auser and buser can rwx GammaDir and all its files;
      • auser and cuser cannot access AlphaDir nor any of its files.
    4. When permissions have been set and tested, use a PowerShell window with your admin account making your Documents the current working directory. Create the PowerShell script ListACL.ps1 in your Documents folder by, e.g., downloading the text file ListACL.txt into your Documents and renaming it ListACL.ps1. Execute the following commands from a PowerShell console with you Documents as working directory:
      .\ListACL -RootPath AlphaDir | Out-File .\WinPerms.txt;
      .\ListACL -RootPath BetaDir | Out-File .\WinPerms.txt -Append;
      .\ListACL -RootPath GammaDir | Out-File .\WinPerms.txt -Append;
      Attach the resulting WinPerms.txt file to this assignment in D2L.
  5. (25 pts) Utilizing Python

    Background

    This task does not have specific, detailed guidance. It should be accessible given your background in Linux / Windows as well as Python.

    A simple algorithm* for finding the greatest common divisor (or GCD) of two positive integers is below. *This algorithm is pseudo-code to show the solution process; it is not Python or any particular implementable language. Converting it to a specific language (e.g., Python) is a task for the student.

    Accept two positive integers A and B
    
    while A != B
        if (A < B)
            B = B - A
        else
            A = A - B
        endif
    endwhile
    
    A (or B since they are the same) is the GCD and can be reported as output.

    In the tasks below use Python to implement this algorithm (i.e., do not use a different algorithm or built in GCD function even if it exists in your Python version).

    1. Linux version

      Based on your background with Python, experience with Ubuntu, and research (e.g., How to Run Python Scripts in Linux Command Line (linuxhandbook.com) implement the GCD algorithm using Python in your xxxxLs1 VM. Create a screen cap named LinPython.jpg (or other image format) of a terminal which shows

      1. the current date & time
      2. the computer's hostname
      3. a listing of the Python script to calculate the GCD
      4. two executions (from the command line) of the script using 35 & 14 as inputs and then 45 & 60 as inputs

      Attach a copy of the LinPython screen capture to this assignment in D2L.

    2. Windows version

      Repeat the previous exercise in your xxxxWS1 VM (e.g., see Get started using Python on Windows for beginners), naming the screen cap WinPython.jpg (or other image format). Attach a copy of the screen capture to this assignment in D2L.