Introduction to Linux

By Drs. Anthony Vance and Dave Eargle

Part 1. Complete this very gentle introduction to the Linux terminal

CodeAcademy has an introductory set of lessons that teach the Linux Terminal. You should complete the first lesson-set within each module:

  1. Navigating the File System
    1. Navigation
  2. Viewing and Changing the File System
    1. Manipulation
  3. Redirecting Input and Output
    1. Redirection
  4. Configuring the Environment
    1. Environment

You do not need to do any of the “projects” or multiple choice quizzes. Just the lesson-sets.

Heads up! Codeacademy recently started charging for access to this set of lessons. As of 9/4/2019, you get free access for seven days, after which you can pay for access for $40 per month. These lessons are not strictly necessary for completing this class, but you may opt to pay if you enjoy the learning style. Alternatively, Udacity has a free set of follow-along video lecture demonstrations which you may enjoy.

Part 2. Play the Bandit wargame on OvertheWire.org

Play the Bandit wargame on OvertheWire.org. Start at Level 0 and complete Level 15 (which gives you the password for Level 16).

To play, you’ll need to connect to the Bandit server using an SSH client. SSH stands for Secure SHell, and allows you to remotely control a server using a command line interface. SSH is secure because your connection to the server is encrypted using a symmetric cipher like AES. It also uses asymmetric cryptography such as RSA to establish the server’s identity.

Using SSH on Windows

If you’re using Windows, download Putty for Windows.

Enter the username (bandit0), server address, and port (2220) into putty like so:

img

Click the Open button. You’ll be presented with a message like the following:

img

This message tells you that you haven’t connected to this server before. The Bandit server is using a ECDSA asymmetric key pair, which is similar to RSA. The fingerprint is a hash of the server’s public key. To learn more about verifying SSH fingerprints, see here.

To continue logging in, click the Yes button.

Using SSH on MacOS

If you’re using a Mac, open Terminal.app and use the ssh command to connect to the Bandit server, like so:

ssh -p 2220 [email protected]

When you first connect to a sever using SSH, you’ll see a message like the following:

img

This message tells you that you haven’t connected to this server before. The Bandit server is using a ECDSA asymmetric key pair, which is similar to RSA. The fingerprint is a hash of the server’s public key. To learn more about verifying SSH fingerprints, see here.

To continue logging in, type yes and press enter.

Instructions

  • When you type in your password, you won’t see any characters. This is a security feature to prevent shoulder surfing. Enter the password bandit0 and press enter to login.
  • Start at Level 0 which requires you to login to the Bandit server using SSH. Next, visit the Level 0 -> Level 1 for instructions on how to get to the next level. Continue until you successfully complete Level 15 -> Level 16, which gives you the password for Level 16.
  • Use the man command and search the web to learn about the recommended commands (i.e., “Commands you may need to solve this level”) to help you reach the next level. Learning for yourself how to use new commands is a key part of this tutorial.

Deliverable

For each level you complete, take a screenshot of your terminal screen showing the following:

  • Show the password for the next level.
  • Run the date command to show the current date.
  • Print out our name like so: echo "Your name"

Add all of the screenshots to Word document and submit the document in the Linux tutorial quiz on Canvas.

img

Supplementary – Optional

Learn a different Linux text editor

The CodeAcademy lessons above give you basic exposure to the nano text editor. However, you are free to use whatever text editor you like, such as Vim (see tutorial here). However, nano is good for beginners.

More thorough walkthrough, but also more difficult

  • Using your Kali VM, go through the following sections of this Linux tutorial:
    • Chapter 2
      • 2.2
      • 2.3
        • 2.3.1
        • 2.3.2
        • 2.3.3.3
      • 2.5
        • 2.5.3
        • 2.5.4
        • 2.5.5
    • Chapter 3
      • 3.1
        • 3.1.3.1
      • 3.2
        • 3.2.1
        • 3.2.2
        • 3.2.3
        • 3.2.4
      • 3.3 (all)
      • 3.4 (all)
      • 3.6.4
      • 3.6.5
    • Chapter 4
      • 4.1
    • Chapter 5
      • 5.1
      • 5.3
    • Chapter 6
    • Chapter 7
      • 7.2.5
      • 7.5.3.2
  • Also learn about
    • sudo
    • man id
    • man 5 passwd
    • man 5 group
    • ssh & scp