Linux Section

Part 1

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.

Part 2

  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:

    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.

Part 3

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.

Windows Section

Part 1

  1. 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.

Part 2

  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:

  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.

Part 3

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.