Hackathon - Linux FUNdamentals
Introduction
This is a learning resource created to help interested people to get Linux skills and an understanding of basic command-line concepts using Azure to build and learn. But it is not restricted to using Azure and you can run this hackathon on any virtual machine using Ubuntu Linux.
Note: This Hackathon were incorporated into the Microsoft What The Hack, as the 1st Linux “Hackathon” by Microsoft! See more at http://aka.ms/wth
Linux History
Linux is a family of free and open-source operating systems based on the Linux kernel. Operating systems based on Linux are known as Linux distributions or distros. Examples include Debian, Ubuntu, Fedora, CentOS, Gentoo, Arch Linux, and many others.
The Linux kernel has been under active development since 1991, and has proven to be extremely versatile and adaptable. You can find computers that run Linux in a wide variety of contexts all over the world, from web servers to cell phones. Today, 90% of all cloud infrastructure and 74% of the world’s smartphones are powered by Linux.
To read more about Linux History, Linux Distributions and Linux Kernel, click here.
Learning Objectives
In this hack you will be challenged with some common tasks from a real world scenario in Linux administration duties, such as:
- Create a Linux Virtual Machine on Azure
- Handle files and directories
- Maninpulate file contents
- Work with standard Linux permissions
- Collect information about Linux processes in your environment
- Management of users and groups
- Basic shell scripting
- Work with disks, partitions and logical volume manager
- Linux package management
- Implement a basic webserver
Challenges
With the exception of challenge 01 which has as an outcome a Linux Virtual Machine which will be required for all other challenges, each challenge can be done separately and they are not interdependent. The level of complexity increases accordingly with the respective number of each one.
- Challenge 01: Create a Linux Virtual Machine
- A Linux Virtual machine is the prerequisite for the challenges, so create a new Ubuntu Linux VM
- Challenge 02: Handling Directories
- Learn how to perform common directory operations such as displaying your current directory and listing directory contents.
- Challenge 03: Handling Files
- Learn basic commands about file manipulation such as create, rename, find and remove files.
- Challenge 04: File Contents
- Learn about file content manipulation and discover how to count file lines, display specific lines from a file, and more.
- Challenge 05: Standard File Permissions
- Learn about the Linux standard file permissions and understand how to work with file permissioning on a Linux environment.
- Challenge 06: Process Management
- Your objectives will involve basic process management, such as checking processes running and identifying process ids.
- Challenge 07: Group and User Management
- In this challenge you will learn about the creation of user and groups in a Linux environment.
- Challenge 08: Scripting
- Learn some basic stuff on shell scripting and the usage of some commands such as echo, cut, read and grep.
- Challenge 09: Disks, Partitions and File Systems
- You will be working with disks and partitions and learn about linx filesystems and commands such as fdisk, mkfs and mount.
- Challenge 10: Logical Volume Manager
- Discover about the Logical Volume Manager on Linux, and how to use commands such as pvcreate, vgcreate, lvrcreate, and more.
- Challenge 11: Package Management
- Learn about package management and common activites such as update package distribution lists, install and uninstall packages.
- Challenge 12: Setting up a Webserver
- In this challenge we will setting up a webserver and deploy a simple PHP application into it. The usage of SSL could be a plus.
- Challenge 13: Protecting a Server
- In this challenge we will discover about how to use Fail2Ban to protect services in a Linux environment.
- Challenge 14: Running Containers
- Your objective in this challenge will be to deploy an Nginx container and access it. If you would like to go deeper, there is another option to deploy a simple PHP application.
Prerequisites
- To run this hackathon on Azure and utilize the Azure Cloud Shell, you will need an Azure subscription with contributor access for Challenge 01 or contributor access to a pre-created Azure Virtual Machine for all other challenges. To run this hackathon on any other cloud provider or even locally, you just need a virtual machine running Ubuntu Linux.
-
Access to a terminal. The terms “terminal,” “shell,” and “command line interface” are often used interchangeably, but there are subtle differences between them:
- A terminal is an input and output environment that presents a text-only window running a shell.
- A shell is a program that exposes the computer’s operating system to a user or program. In Linux systems, the shell presented in a terminal is a command line interpreter.
-
A command line interface is a user interface (managed by a command line interpreter program) which processes commands to a computer program and outputs the results.
When someone refers to one of these three terms in the context of Linux, they generally mean a terminal environment where you can run commands and see the results printed out to the terminal.
Becoming a Linux expert requires you to be comfortable with using a terminal. Any administrative task, including file manipulation, package installation, and user management, can be accomplished through the terminal. The terminal is interactive: you specify commands to run and the terminal outputs the results of those commands. To execute any command, you type it into the prompt and press ENTER.
For our activites, it is recommended to use the Azure Cloud Shell.
- There are some basic concepts that will be nice if you have them. If you would like to take a look they are listed here.
- Concepts around the Linux Filesystem Hierarchy Standard (FHS) are recommended, so you can get more details about it here.
- Regarding Linux commands, just for reference, here is a good cheat sheet.
- The Linux man pages are your best friend. Make sure to use as best you can.
Learning Resources
Coach’s Guide
In the coach directory are the guidelines in case you are running the Hackathon in an event and are a coach, as well as the solutions for the proposed challenges. If you’re doing the Hackathon as a student, don’t be fooled by looking at the solutions during the hack! Go learn something. :)
Contributions
Contributions in the form of errors, feature requests and PRs are always welcome. Please follow these steps before submitting a PR:
- Create an issue describing the error or feature request.
- Clone the repository and create a topic branch.
- Make changes, adding new tests for new functionality.
- Submit a PR.
Show your support
Give a ⭐️ if this content helped you!