CY 2550 - Foundations of Cybersecurity

Project: Linux Basics

This project is due at 11:59pm on Friday, February 5.

Description and Deliverables

This class has projects that require the use of the command line. Since different OS's have different command line environments, we will use Ubuntu 20.04 OS as a concrete example for the whole class. When we provide examples in the future, or when students ask us to help debug problems, we will assume that everything is being done on Ubuntu 20.04.

Even if you already have a bash command line (e.g., you use Linux, own a Mac, or have installed WSL on Windows 10) for this project we ask that everyone complete the following steps in full. Later on, if you want to use your own command line, so be it.

Steps to Complete The Project

To receive full credit for this project, complete the following steps. Ultimately, you will turn in three files that you will produce during the steps.

  1. If you don’t already have an account on Github, you will need to get one. You can sign-up for one at Github.
  2. Register using this form to make our course staff aware of your Github username.
  3. Create a new git repository in your Github account that will hold all of your CY 2550 project files throughout the semester. This repository is also how you will turn-in projects. Click on "Create a Repository" in your Github account. Name your repository "cy2550", set the visibility-level to Private, and select "Initialize repository with README." Click "Create project". You should see a Github repository page now.
  4. Install VirtualBox on your own computer.
  5. Download an ISO image of Ubuntu 20.04 Desktop.
  6. Open VirtualBox and create a new Virtual Machine (VM). Make sure to allocate at least 2GB of RAM and 10GB of disk space to the new VM.
  7. Install Ubuntu 20.04 into your new VM. Follow the prompts to complete the installation of Ubuntu into the VM. A useful tutorial can be found here.
  8. Once Ubuntu is installed, reboot the VM, wait for Ubuntu to load, and log-in to your new Ubuntu installation using the credentials you provided during setup.
  9. Open a command line (also known as a terminal) and install the screenfetch and git programs using the apt tool. You can think of apt as the app store for Ubuntu: it lets you install new programs from the command line. Of course, to do this you need administrator privileges, so you also need to use the sudo command. Putting it all together, execute the following command:
     $ sudo apt install screenfetch git
  10. Make sure you're in your home directory (e.g., by running cd ~) then check out your newly created git repository. To do this, go back to the Github repository page, and click the "Clone" button. Under "Clone with HTTPS", copy the URL and then run this command:
    $ git clone <copied url, e.g. https://github.com/<your username>/cy2550.git>
    The prompt will ask you for your Github credentials.
  11. Make a new directory for project 1 and then enter this directory.
    $ mkdir -p ~/cy2550/project1
    $ cd ~/cy2550/project1
    mkdir is a program that makes directories (i.e., folders) on the hard drive. The tilde character is a shortcut that always refers to your home directory (typically /home/your_username/).
  12. If you run the screenfetch program, it will print out useful information about Ubuntu and your system. Run screenfetch again, but redirect the output (using the > operator) to a file on disk named ~/cy2550/project1/sf-output.txt.
  13. Run the ps -ef program and redirect the output to a file named ~/cy2550/project1/ps-output.txt.
  14. Create a file named ~/cy2550/project1/hello.txt (using a text editor of your choosing, such as emacs, vim, or nano). This file must contain your full name and Github username exactly in this format:
    Hi, my name is Christo Wilson and my Github user name is bowlinearl.
  15. At this point, your ~/cy2550/project1/ directory should contain three files. You can use the ls program to make sure. You are now ready to turn-in the project using the instructions below.
Throughout these steps, you will be using various Linux command line programs. Most programs have built-in help messages if you run them with "--help" or "-?" as the command line argument. Furthermore, all programs have helpful Manual Pages that you can access by running:
$ man <program_name>
These various sources of help text may be useful if you get stuck during the project.

Learning the Linux Command Line

Martin Petrauskas has put together a helpful guide that explains how to setup VirtualBox (including how to change several important settings). This guide also has several chapters on basic Linux command line usage that may prove useful throughout this course if you are unfamiliar with the Linux command line. The guide is a work-in-progress, and the latest version can always be found here:

Submitting Your Project

In this class you will turn-in projects by checking in files to your Github repository, and then submitting your repository via Gradescope. Gradescope is accessible via this classes Canvas page.

To start things off, you'll need to do some one-time setup of git in your VM. Then you'll be able to push your project files to your repository and submit them.

  1. You first need to do some setup to tell git who you are. Configure git with your preferred username (this does not need to match your GitHub username) and email address:
    $ git config --global user.name "your-username"
    $ git config --global user.email "your-email-address@whatever.com"
  2. Prepare your commit. If you are already in the ~/cy2550/project1 directory, then you can do the following:

    $ git add sf-output.txt ps-output.txt hello.txt
    $ git commit -m "Initial commit to project 1"
    The first command tells git that the three files listed should be part of a "commit." A commit represents a change to the state of the repository. It can include new files, modified files, or deleting of files from the state of the repository. In this case, you are adding three new files to the repository.

    The second command formalizes the changes to your local git repository. The -m flag gives a short informative message that describes this commit.

    You can make as many changes as you like to your local repository in this way. When you edit larger pieces of software it is important to make incremental commits as you develop a solution. For example, if you decide to edit the hello.txt file and want to formalize the new state:

    $ git add hello.txt
    $ git commit -m "Edit to hello.txt"

  3. When you are ready, you need to push this local commit to Github:
    $ git push
    This command will ask for your Github credentials. Pushing uploads all the committed changes to your local repository to Github, including files you've checked in and the history of edits to those files. This is how some large software projects manage collaboration across thousands of developers working on different parts of the system, while keeping a consistent view of the "latest" changes.
  4. Return to your Github repository webpage and check that your project 1 files are now there.
  5. Go to Gradescope and submit your assignment.
    • Select the appropriate assignment and then choose Github as the submission method.
    • The first time you submit your repository, you will need to authorize Gradescope to access your git repository. Select the appropriate repository and master branch.
Once assignments are completely graded, you will be able to see your grade and assignment feedback on Gradescope. Grades will also be synched with Canvas.

Grading

This project is worth 5% of your final grade, broken down as follows (out of 100): Points can be lost for turning in files in incorrect formats (e.g. not ASCII) or failing to follow specified formatting or naming conventions.