CHALLENGE INFORMATION

Platform: TryHackMe
Path: Pre Security
Module: Linux Fundamentals
Room: Linux Fundamentals Part 1
Description: Embark on the journey of learning the fundamentals of Linux. Learn to run some of the first essential commands on an interactive terminal.

Introduction

This room introduces the basics of the Linux operating system and provides hands-on experience with fundamental commands. We begin by deploying an interactive terminal and progress through essential navigation and file system operations.

Question 1: Let’s get started!

No answer needed.

A Bit of Background on Linux

Before diving into commands, we examine the origins of Linux. The Linux kernel was first released by Linus Torvalds in 1991 as a free and open-source operating system kernel.

Question 1: Research: What year was the first release of a Linux operating system?

1991

Interacting with Your First Linux Machine (In-Browser)

We deploy our first Linux virtual machine using TryHackMe’s in-browser terminal. This provides a sandboxed environment for practicing commands without requiring local installation.

Question 1: I’ve deployed my first Linux machine!

No answer needed.

Running Your First Few Commands

This section covers basic command execution. The echo command outputs text to the terminal, and the whoami command displays the current username.

Question 1: If we wanted to output the text TryHackMe, what would our command be?

echo "TryHackMe"

Question 2: What is the username of who you’re logged in as on your deployed Linux machine?

tryhackme

Interacting with the File System!

We explore the Linux file system hierarchy using commands such as ls to list directories, cd to change directories, and cat to display file contents. Understanding file system navigation is essential for effective Linux operation.

Question 1: On the Linux machine that you deploy, how many folders are there?

4

Question 2: Which directory contains a file?

folder4

Question 3: What are the contents of this file?

Hello World

Question 4: Use the cd command to navigate to this file and find out the new current working directory. What is the path?

/home/tryhackme/folder4

Searching for Files

The grep command allows us to search for patterns within files. This is particularly useful for filtering log files or searching for specific strings, such as flags.

Question 1: Use grep on access.log to find the flag that has a prefix of THM. What is the flag?

<redacted-flag>

Question 2: And I still haven’t found what I’m looking for!

No answer needed.

An Introduction to Shell Operators

Shell operators provide powerful redirection and process control capabilities. The ampersand (&) runs commands in the background, while the angle brackets (> and >>) handle output redirection. The single greater-than (>) overwrites file contents, and the double greater-than (>>) appends to existing files.

Question 1: If we wanted to run a command in the background, what operator would we want to use?

&

Question 2: If I wanted to replace the contents of a file named passwords with the word password123, what would my command be?

echo password123 > passwords

Question 3: Now if I wanted to add tryhackme to this file named passwords but also keep passwords123, what would my command be?

echo tryhackme >> passwords

Question 4: Now use the deployed Linux machine to put these into practice.

No answer needed.

Conclusions and Summaries

This room established foundational skills in Linux command-line operation, including navigation, file manipulation, text output, and redirection operators. These concepts form the basis for more advanced system administration and security tasks.

Question 1: I’ll have a play around!

No answer needed.

Linux Fundamentals Part 2

Upon completing this room, we terminate the deployed machine to conserve resources and proceed to the next module in the series.

Question 1: Terminate the machine deployed in this room from task 3.

No answer needed.

Question 2: Join Linux Fundamentals Part 2!

No answer needed.