Fundamental concepts of Linux — Part I

CyberTalent
4 min readDec 15, 2023

--

Aspiring hackers often lack familiarity with Linux, hindering their progress toward becoming professional white hat hackers. Linux is the platform of choice for hacking, but learning the basics of Linux is necessary to become a hacker. This article series provides the fundamental knowledge of Linux that every hacker needs to succeed.

I will try to develop your skills in Linux slowly and logically so that you can do the many hacks I will show you here on CyberTalent.

In this tutorial, I will guide you through the basics of getting started with Kali Linux. While all the examples I provide will be with Kali terminal commands, the principles can be applied to almost any Linux distribution.

Open a Terminal

When using Linux, the first step is typically to open a terminal. In Kali Linux, we can find the terminal icon at the top of the page and double-click it, or we can simply type as follows:

control+alt+t

When you click on the terminal or type Ctrl+Alt+T, a terminal window will open.

When you open this terminal, it will automatically open a shell. A shell is a command-line environment that allows you to execute commands on the operating system and create scripts (more on scripts later). Linux has several shell environments, but the most commonly used one is the BASH or Bourne Again Shell. This is the default shell in Kali and many other Linux distributions.

File System

In contrast to the Windows file system, Linux systems are not constrained by the physical drive. The Linux file system has the root or “/” at the top of its file structure. This does not signify the physical drive, but merely marks the top of the logical file structure.

Please note the diagram of the Linux file system above. At the top of the file system, you will find the / or root of the file system. It’s essential to note that this is not the same as the “root” user, and they shouldn’t be confused. In this context, the root is simply the base of the file structure. For beginners, some of the most important sub-directories under / are:

1. “/root” represents the home directory of the root user, who has all the administrative privileges.

2. The “/etc” directory is usually where all the configuration files are stored in Linux.

3. “/home” is the home directory of a specific user.

4. “/mnt” is a directory where other file systems can be attached or mounted to the main file system.

5. “/bin” is the directory where executable files, or binaries, are stored in Linux. It is similar to the “Program Files” folder in Windows.

6. The “/lib” directory is where libraries are stored. These are programs that can be shared between different applications and processes, similar to DLL files in Windows.

We will revisit these key directories in a later tutorial. For now, it is sufficient to have a general understanding of the Linux file system.

pwd

At times, while working in Linux, it becomes important to know the current working directory. The ‘pwd’ command helps in returning the present working directory, which is the directory where you are currently located in the directory structure. This information can be crucial while moving through various directories. Let’s try typing ‘pwd’ to see where we are presently located.

As you can see, Linux returned /root telling us we are in the root user’s directory. If we had been in another directory, it would have returned that directory name as we will see below.

whoami

In Linux, we can log in as any legitimate user. However, as the system administrator, it is not recommended to log in as “root” when performing routine tasks as this can compromise the system’s security. If someone manages to hack into your system while you are logged in as root, they will immediately gain root privileges and take over the system. To avoid this, it is better to log in as a regular user.

If you forget who you are logged in as, you can use the “whoami” command to check.

--

--

CyberTalent
CyberTalent

Written by CyberTalent

Unlock your cyber potential with CyberTalent's Cyberedu Hub - where knowledge meets security expertise

No responses yet