section: “cyber-shujaa” categories: [“cyber-shujaa”] title: “Intro Linux Fundamentals” date: 2025-06-11
LINUX FUNDAMENTALS
1.0 INTRODUCTION
I see Linux as a powerful, secure, and flexible open-source operating system that plays a crucial role in cybersecurity. It manages hardware and software resources, much like Windows or macOS, but is unique due to its many distributions tailored to different needs.
It all started with Unix in the 1970s, leading to the GNU Project and, finally, the Linux kernel by Linus Torvalds in 1991. Now, Linux powers servers, desktops, smartphones (like Android), and embedded systems.
I appreciate Linux’s philosophy simplicity, modularity, and openness. It favors small, single-purpose tools that can be chained together for complex tasks, mostly managed through the shell (CLI).
Linux is structured into components like the bootloader, kernel, shell, daemons, and GUI. Its architecture consists of layers hardware, kernel, shell, and system utilities.
The file system follows a tree-like structure starting from /
, with key directories like /bin
for commands, /etc
for configs, /home
for user data, and /var
for logs.
Philosophy
Linux philosophy is centered on simplicity, modularity and openness.
Components
Linux Architecture
The Linux operating system can be broken down into layers:
File System Hierarchy
1.1 Linux Distributions
I understand that Linux distributions (distros) are all based on the Linux kernel but differ in the packages, tools, and configurations they offer. Each distro is like a different flavor of the same base system, tailored for specific purposes whether desktop use, servers, or cybersecurity.
For desktop use, I prefer options like Ubuntu or Fedora because they’re beginner-friendly. For cybersecurity, I lean toward distros like Kali Linux, Parrot OS, or BlackArch since they come with preinstalled tools for security analysis.
Debian stands out to me for its stability, reliability, and strong security practices. It uses the apt package manager, supports long-term updates, and is very customizable although that comes with a steeper learning curve. Still, I see it as worth the effort, especially when I want more control over my system.
Overall, I value Linux for being open-source, secure, and flexible especially as a cybersecurity specialist who needs a system I can tweak and trust.
1.2 Introduction to Shell
The Linux shell is a text-based interface that allows me to communicate directly with the operating system. It may seem intimidating at first, but I think of it as a more powerful version of a GUI: while a GUI uses icons and buttons, the shell uses commands giving me more flexibility and control.
To access the shell, I use a terminal emulator. This is basically a graphical interface that simulates the traditional terminal, allowing me to run shell commands in a modern desktop environment. I like to think of the shell as the system’s engine room, and the terminal emulator as the control panel I use to issue instructions.
2.0 The Shell
Now that I’ve built a solid understanding of the Linux structure, distributions, and especially the shell, I’ve started putting that knowledge to real use by working directly in the terminal. One key skill I quickly realized was essential is knowing how to get help with commands I’m not familiar with.
Linux is vast, and it’s unrealistic to memorize every option for every command. Sometimes I’ll come across tools I’ve never seen before, or I’ll forget optional flags for a command I’ve used in the past. That’s why I’ve made it a habit to always check available documentation before using a new command. The two main ways I get help are through the man pages and the –help/-h options.
For example, when I used the ls command to list files in a directory:
ls
I saw all the folders like Documents, Downloads, and Music. But to go further and learn about additional options, I used:
man ls
This is especially helpful when I don’t want to scroll through a full manual. Some tools even support a shorter version:
curl -h
Interestingly, curl -h and curl –help give similar outputs, just in slightly different formats. Another command I found valuable is:
apropos
This command searches the short descriptions in the man pages. For example, when I typed:
apropos sudo
I received a list of all commands and manual sections related to sudo, which is a great way to explore relevant tools even if I’m unsure what I’m looking for.
I also discovered a web resource called https://explainshell.com, which visually breaks down complex commands by explaining each component. This is super useful when I encounter long command chains and want to understand what’s happening step-by-step.
With all these resources, I now feel more confident exploring Linux commands, even ones I’ve never used before. I know how to investigate, understand, and try them out safely.
Task
3.0 Workflow
Navigation
Navigation is the process of moving around and finding your way within a physical or digital environment to reach a desired destination or access specific information or resources.
Question 1: What is the name of the hidden “history” file in the htb-user’s home directory?
Question 2: What is the index number of the “sudoers” file in the “/etc” directory?
-i stands for a list files and directories in a directory along with their corresponding inode numbers in Linux.
4.0 Working with files and directories
Question 1: What is the name of the last modified file in the “/var/backups” directory?
-lt stands for display the files and directories in that directory, with the most recently modified ones appearing at the top of the list.
Question 2: What is the inode number of the “shadow.bak” file in the “/var/backups” directory?
Find Files and Directories
Question 1: What is the name of the config file that has been created after 2020–03–03 and is smaller than 28k but larger than 25k?
Question 2: How many files exist on the system that have the “.bak” extension?
Question 3: Submit the full path of the “xxd” binary.
File Descriptors and Redirections
Question 1: How many files exist on the system that have the “.log” file extension?
Question 2: How many total packages are installed on the target system?
Filter Contents
Question 1: How many services are listening on the target system on all interfaces? (Not on localhost and IPv4 only)
Question 2: Determine what user the ProFTPd server is running under. Submit the username as the answer.
Question 3: Use cURL from your Pwnbox (not the target machine) to obtain the source code of the “https://www.inlanefreight.com" website and filter all unique paths of that domain. Submit the number of these paths as the answer.
4.0 System Management
User management
Question 1: Which option needs to be set to create a home directory for a new user using “useradd” command?
Question 2: Which option needs to be set to lock a user account using the “usermod” command? (long version of the option)
Question 3: Which option needs to be set to execute a command as a different user using the “su” command? (long version of the option)
5.0 Service and process management
Question 1: Use the “systemctl” command to list all units of services and submit the unit’s name with the description “Load AppArmor profiles managed internally by snapd” as the answer.
Task Scheduling
Question 1: What is the type of the service of the ““dconf.service”?
6.0 Working with Web Services
Question 1: Find a way to start a simple HTTP server inside Pwnbox or your local VM using “npm”. Submit the command that starts the web server on port 8080 (use the short argument to specify the port number).
Question 2: Find a way to start a simple HTTP server inside Pwnbox or your local VM using “php”. Submit the command that starts the web server on the localhost (127.0.0.1) on port 8080.
File System Management
How many disks exist in our Pwnbox? (Format: 0)
Conclusion
Completing the Linux Fundamentals module on HTB Academy has been a transformative experience. Starting with minimal exposure to Linux, I’ve now gained a solid understanding of its core concepts, including file systems, user management, permissions, and essential command-line tools. This journey has not only enhanced my technical skills but also boosted my confidence in navigating and utilizing Linux systems effectively. I’m excited to apply this knowledge in real-world scenarios and continue my learning in the field of cybersecurity.