Skip to content
Home » Google Career Certificates » Google Cybersecurity Professional Certificate » Tools of the Trade: Linux and SQL » Week 2: The Linux operating system

Week 2: The Linux operating system

You will be introduced to the Linux operating system and learn how it is commonly used in cybersecurity. You’ll also learn about Linux architecture and common Linux distributions. In addition, you’ll be introduced to the Linux shell and learn how it allows you to communicate with the operating system.

Learning Objectives

  • Discuss why Linux is commonly used in the security profession.
  • Describe the architecture of the Linux operating system.
  • Identify the unique features of common Linux distributions.
  • Describe how a shell provides an interface for the user to interact with the operating system.

All about Linux


Video: Welcome to module 2

This section explores the Linux operating system and its use in security. It discusses the architecture of Linux, compares different distributions, and introduces the shell. The author shares their excitement about learning Linux with the reader.

Welcome back! We have another
important topic to explore. Previously, you learned about operating systems
and user interfaces. You learned how operating
systems work and how resources are
allocated in computers. We also reviewed several
common operating systems. You may already have a
favorite operating system. It’s common to hear that
people are fans of one over another, but in
the security world, Linux is commonly used. In this section, you’ll
be learning more about the Linux operating
system and how it’s used in everyday
tasks in security. First, you’ll learn about
the architecture of Linux. After this, we’ll compare the different distributions
of Linux that are available. Lastly, you’ll
explore the shell, a key Linux component that allows you to communicate
with the system. I remember when I
first learned about the Linux OS, and I’m really happy to
explore it with you now.

Video: Introduction to Linux

Linux is an open-source operating system that is widely used in security. It has several unique features that make it well-suited for security tasks, including its open-source nature, its large community of developers, and its wide variety of distributions.

Some of the ways that Linux is used in security include:

  • Examining logs to identify suspicious activity
  • Verifying access and authorization in identity and access management systems
  • Using digital forensic tools to investigate incidents
  • Using pen testing tools to look for vulnerabilities

Linux is a valuable skill for security professionals to have, and it is a good choice for both entry-level and experienced security analysts.

Introduction to Linux

Linux is a free and open-source operating system that is widely used in servers, workstations, and embedded systems. It is known for its stability, security, and flexibility.

What is an operating system?

An operating system is the software that manages your computer’s hardware and resources, and provides a platform for running applications. It is responsible for tasks such as:

  • Booting up your computer
  • Loading and running applications
  • Managing files and folders
  • Controlling input and output devices
  • Providing a user interface

What is Linux?

Linux is a family of Unix-like operating systems that are based on the Linux kernel. The Linux kernel is the core of the operating system, and it is responsible for managing the system’s hardware resources.

Linux is distributed in the form of distributions. A Linux distribution is a collection of software that includes the Linux kernel, system utilities, and a selection of applications.

Some popular Linux distributions include:

  • Ubuntu
  • Debian
  • Fedora
  • CentOS
  • Arch Linux

Why use Linux?

There are many reasons to use Linux, including:

  • It is free and open-source.
  • It is stable and secure.
  • It is flexible and customizable.
  • It has a wide range of distributions to choose from.
  • It is widely used in industry.

Getting started with Linux

If you are new to Linux, the best way to get started is to install a Linux distribution on your computer. You can download a Linux distribution ISO image from the distribution’s website and then install it using a bootable USB drive or DVD.

Once you have installed Linux on your computer, you can begin to learn how to use it. There are many resources available online and in libraries that can teach you about Linux.

Some basic Linux commands

Here are some basic Linux commands that you should know:

  • ls: Lists the contents of the current directory.
  • cd: Changes the current directory.
  • pwd: Prints the current working directory.
  • mkdir: Creates a new directory.
  • rmdir: Removes an empty directory.
  • touch: Creates a new file.
  • cp: Copies a file or directory.
  • mv: Moves a file or directory.
  • rm: Removes a file or directory.
  • sudo: Allows you to run commands with root privileges.

Learning more about Linux

There are many resources available online and in libraries that can teach you more about Linux. Here are a few suggestions:

  • The Linux Documentation Project website has a comprehensive collection of Linux documentation.
  • The Linux Foundation website offers a variety of Linux training courses.
  • The book “Linux in a Nutshell” is a good introduction to Linux for beginners.
  • The book “The Linux Command Line” is a comprehensive guide to the Linux command line.

Conclusion

Linux is a powerful and versatile operating system that can be used for a wide range of tasks. It is a good choice for both beginners and experienced users. If you are interested in learning more about Linux, there are many resources available to help you get started.

How do security analysts use Linux? Select three answers.
  • To verify access and authorization in an identity and access management system
  • To use digital forensic tools to investigate what happened following an event
  • To examine different types of logs to identify what is going on in a system

Security analysts use Linux to verify access and authorization in an identity and access management system. They also use Linux to examine logs and to investigate what happened in an event.

You might have seen or
heard the name Linux in the past. But did you know Linux is the most-used
operating system in security today? Let’s start by taking a look at Linux and
how it’s used in security. Linux is an open-source operating system. It was created in two parts. In the early 1990s, two different people
were working separately on projects to improve computer engineering. The first person was Linus Torvalds. At the time, the UNIX operating
system was already in use. He wanted to improve it and make it
open source and accessible to anyone. What was revolutionary was his
introduction of the Linux kernel. We’re going to learn what
the kernel does later. Around the same time,
Richard Stallman started working on GNU. GNU was also an operating
system based on UNIX. Stallman shared Torvalds’ goal of
creating software that was free and open to anyone. After working on GNU for
a few years, the missing element for the software was a kernel. Together, Torvalds’ and Stallman’s innovations
made what is commonly referred to as Linux. Now that you’ve learned
the history behind Linux, let’s take a look at
what makes Linux unique. As mentioned before, Linux is open source, meaning anyone can have access to
the operating system and the source code. Linux and many of the programs that come
with Linux are licensed under the terms of the GNU Public License, which allow you
to use, share, and modify them freely. Thanks to Linux’s open-source philosophy
as well as a strong feature set, an entire community of developers
has adopted this operating system. These developers are able to
collaborate on projects and advance computing together. As a security analyst, you’ll discover that Linux is
used at different organizations. More specifically,
Linux is used in many security programs. Another unique feature about Linux
is the different distributions, or varieties, that have been developed. Because of the large
community contribution, there are over 600 distributions of Linux. Later you’ll learn more
about distributions. Finally, let’s take a look at how you
would use Linux in an entry-level security position. As a security analyst, you’ll use many
tools and programs in everyday work. You might examine different types of logs
to identify what’s going on in the system. For example, you might find yourself looking at
an error log when investigating an issue. Another place where you will use
Linux is to verify access and authorization in an identity and
access management system. In security, managing access is key
in order to ensure a secure system. We’ll take a closer look into access and
authorization later. Finally, as an analyst,
you might find yourself working with specific distributions designed for
a particular task. For example, you might use a distribution
that has a digital forensic tool to investigate what
happened in an event alert. You might also use
a distribution that’s for pen testing in offensive security to
look for vulnerabilities in the system. Distributions are created to
fit the needs of their users. I hope you’re excited to
learn more about Linux. This will be a very useful
skill in the security field.

Video: Phil: Learn and grow in the cybersecurity field

Phil is the Chief Information Security Officer for Google Cloud, and he says that cybersecurity is a big space where you need to learn continuously. He also says that you don’t have to learn everything all at once, and that you can learn as you go. He recommends starting off by writing a few lines of simple code or looking at somebody else’s code and trying to understand what it does and then change it a little bit. He also says that it’s important to build a foundation of knowledge that gives you the ability to learn other things.

Hi, I’m Phil I’m the Chief Information Security
Officer for Google Cloud, and a big part of that is,
of course, cybersecurity. So, in cyber you’ve
always got to learn, you’ve always got to
stay up to date for the simple reason
that technology and business and the world of our, kind of digital lives is
just always changing. The online services that you use today are probably
very different even just when what they
were 12 months ago. In the mid ’90s, I
worked on one of the world’s first
internet banking systems. And essentially we were building and coding all of the
security ourselves. I remember working on
the first web browsers, the first web servers, the first implementations of
encryption on the Internet. This was even before
Google even existed. And so this was the very beginning of the Internet and we were
literally kind of assembling and building this and
learning how to do it as we went along. When you are first getting
into cybersecurity, it’s important to
not get overwhelmed. It’s a very big space. And all of us started off
at where you are today. And we had to learn into that. At one point, I
didn’t know Linux, I didn’t know how to program. I didn’t know various parts
of other operating systems. And I had to learn step-by-step, how all of that worked and gradually build up that
knowledge over time. And even now I still have to look things up
occasionally because I don’t keep
everything in my head all at once and
that’s totally fine. When you’re approaching
a new situation, you’re always going to
have a degree of anxiety about whether you’re going to be able to learn it quickly enough. And generally, with
enough experience, you’re gradually comfortable
that you will. But again, this is important
to remember that you don’t have to learn everything
about everything all at once. Most of the time
you learn enough to be enough of value in the
initial part of the process, then you learn as you go. Start off by writing
a few lines of simple code or looking at somebody else’s
code and trying to understand what it does
and then change it a little bit and just
incrementally work into this. Build that foundation
of knowledge that gives you the ability
to learn other things, and I think things
will stem from that.

Video: Linux architecture

The components of the Linux architecture are:

  • User: The person interacting with the computer.
  • Applications: Programs that perform specific tasks.
  • Shell: A command line interpreter that processes commands and outputs the results.
  • Filesystem Hierarchy Standard (FHS): Organizes data.
  • Kernel: Manages processes and memory, and communicates with the hardware.
  • Hardware: The physical components of a computer.

Linux Architecture Tutorial

Linux is a Unix-like operating system that is based on the Linux kernel. The Linux kernel is the core of the operating system, and it is responsible for managing the system’s hardware resources.

The Linux architecture is divided into the following layers:

  • Hardware layer: This layer consists of the physical hardware components of the computer, such as the CPU, memory, and storage.
  • Kernel layer: This layer contains the Linux kernel, which is responsible for managing the system’s hardware resources, such as the CPU, memory, and file system.
  • System library layer: This layer contains the system libraries, which provide the basic functionality of the operating system, such as file I/O and networking.
  • Shell layer: This layer contains the shell, which is a command-line interpreter that allows users to interact with the operating system.
  • Application layer: This layer contains the user applications, such as web browsers, text editors, and office suites.

The following diagram illustrates the Linux architecture:

                    +------------+
                    | Application |
                    +------------+
                        |
                        |
                        v
                    +------------+
                    | Shell      |
                    +------------+
                        |
                        |
                        v
                    +------------+
                    | Kernel      |
                    +------------+
                        |
                        |
                        v
                    +------------+
                    | Hardware   |
                    +------------+

The kernel is the most important layer in the Linux architecture. It is responsible for managing all of the system’s resources, including the CPU, memory, file system, and networking. The kernel also provides a set of system calls that allow user applications to interact with the hardware.

The shell is the interface between the user and the kernel. It allows users to enter commands and to view the results of those commands. The shell also provides a number of built-in commands, such as ls, cd, and mkdir.

The system library layer provides the basic functionality of the operating system, such as file I/O and networking. User applications use the system libraries to access the system’s resources.

The application layer contains the user applications, such as web browsers, text editors, and office suites. User applications are written in a variety of programming languages, such as C, C++, and Java.

Learning more about Linux architecture

There are many resources available online and in libraries that can teach you more about Linux architecture. Here are a few suggestions:

  • The Linux Documentation Project website has a comprehensive collection of Linux documentation, including a section on architecture.
  • The Linux Foundation website offers a variety of Linux training courses, including a course on Linux architecture.
  • The book “Linux in a Nutshell” has a good chapter on Linux architecture.

Conclusion

Understanding the Linux architecture is an important step in learning how to use Linux effectively. By understanding the different components of the architecture and how they interact with each other, you will be able to troubleshoot problems and optimize your Linux system.

What is the kernel’s role in the Linux operating system?

It manages processes and memory.

The kernel is the component of the Linux OS that manages processes and memory.

Let me start with a
quick question that may seem unrelated to security. Do you have a favorite building? And what is it about its architecture that
impresses you the most? The windows? The
structure of the walls? Just like buildings,
operating systems also have an architecture
and are made up of discrete components that work
together to form the whole. In this video, we’re
going to look at all the components that
together make up Linux. The components of Linux include
the user, applications, the shell, the Filesystem
Hierarchy Standard, the kernel, and the hardware. Don’t worry—we’ll go into these components one
by one together. First, you are the user. The user is the person
interacting with the computer. In Linux, you’re
the first element to the architecture of
the operating system. You’re initiating the tasks or commands that the OS
is going to execute. Linux is a multi-user system. This means that more
than one user can use the system’s resources
at the same time. The second element
of the architecture is the applications
within a system. An application is a program that performs a specific task, such as a word processor
or a calculator. You might hear the
word “applications” and “programs” used
interchangeably. As an example, one popular Linux
application that we’ll learn more
about later is Nano. Nano is a text editor. This simple application helps you keep notes on the screen. Linux applications are commonly distributed through
package managers. We’ll learn more about
this process later. The next component
in the architecture of Linux is the shell. This is an important
element because it is how you will
communicate with the system. The shell is a command
line interpreter. It processes commands
and outputs the results. This might sound familiar. Previously, we learned about the two types
of user interfaces: the GUI and the CLI. You can think of
the shell as a CLI. Another element of
the architecture of Linux is the Filesystem
Hierarchy Standard, or FHS. It’s the component of the Linux
OS that organizes data. An easy way for
you to think about the FHS is to think about it
as a filing cabinet of data. The FHS is how data is
stored in a system. It’s a way to organize
data so that it can be found when the data is
accessed by the system. That brings us to the kernel. The kernel is a component of the Linux OS that manages
processes and memory. The kernel communicates
with the hardware to execute the commands
sent by the shell. The kernel uses
drivers to enable applications to execute tasks. The Linux kernel helps
ensure that the system allocates resources
more efficiently and makes the
system work faster. Finally, the last component of the architecture
is the hardware. Hardware refers to the physical
components of a computer. You can compare this to
software applications which can be downloaded
into a system. The hardware in your
computer are things like the CPU, mouse,
and keyboard. Congratulations! We’ve now covered
the architecture of Linux. An understanding of these components will help you become increasingly
familiar with Linux.

Reading: Linux architecture explained

Reading

Practice Quiz: Test your knowledge: All about Linux

As a security analyst, you might use Linux to review logs when investigating an issue.

Which of the following are components of the Linux architecture? Select all that apply.

Fill in the blank: The Filesystem Hierarchy Standard (FHS) is the component of Linux architecture that _____.

Which of the following hardware components are peripheral devices? Select all that apply.

Linux distributions


Video: Linux distributions

Linux is a customizable operating system that is available in many different versions, called distributions. Each distribution has its own unique set of tools and apps, making it important to understand the distribution you are using.

Linux distributions can be compared to different types of vehicles, each with its own purpose. For example, Debian is a general-purpose distribution, while Kali Linux is specifically designed for security testing.

Linux distributions are created by modifying the Linux kernel, which is the core of the operating system. All distributions are derived from another distro, but there are a few that are considered parent distributions, such as Red Hat and Slackware.

Ubuntu and Kali Linux are both derived from Debian, and are two of the most commonly used distributions by security analysts.

Key takeaways:

  • Linux is a customizable operating system with many different distributions to choose from.
  • Each distribution has its own unique set of tools and apps, so it is important to understand the distribution you are using.
  • Linux distributions can be compared to different types of vehicles, each with its own purpose.
  • Kali Linux is a popular distribution specifically designed for security testing.
  • Ubuntu and Kali Linux are both derived from Debian, and are two of the most commonly used distributions by security analysts.

What is a Linux distribution?

A Linux distribution is a version of the Linux operating system that includes a package manager, a set of pre-installed software, and a graphical user interface (GUI). Linux distributions are created by different organizations and individuals, and each distribution has its own unique features and strengths.

Why are there so many Linux distributions?

There are many reasons why there are so many Linux distributions. One reason is that Linux is open source, which means that anyone can modify and distribute the source code. This has led to a wide variety of different distributions, each with its own focus and purpose.

Another reason for the diversity of Linux distributions is that Linux is very customizable. This allows users to choose a distribution that meets their specific needs and requirements. For example, some distributions are designed for general-purpose use, while others are designed for specific tasks such as security testing or web development.

Which Linux distribution should I choose?

The best Linux distribution for you will depend on your individual needs and requirements. If you are new to Linux, it is a good idea to start with a general-purpose distribution such as Ubuntu or Fedora. These distributions are easy to install and use, and they come with a wide range of pre-installed software.

If you are looking for a distribution that is specifically designed for security testing, Kali Linux is a good option. Kali Linux comes with a wide range of pre-installed security tools, making it a great choice for security professionals.

Here are some of the most popular Linux distributions:

  • Ubuntu
  • Fedora
  • Linux Mint
  • Elementary OS
  • Zorin OS
  • Deepin
  • Manjaro
  • Kali Linux
  • Parrot OS
  • Tails
  • BackBox Linux

How to install a Linux distribution

Installing a Linux distribution is relatively straightforward. Most distributions offer a graphical installer that will walk you through the process step-by-step.

To install a Linux distribution, you will need a bootable USB drive or DVD. You can create a bootable USB drive using a tool such as Rufus.

Once you have a bootable USB drive, you can boot your computer from the USB drive. This will start the graphical installer for the Linux distribution that you are installing.

The graphical installer will guide you through the installation process. You will need to choose a language, keyboard layout, and partition scheme. You will also need to create a user account.

Once the installation is complete, you will be able to log in to your new Linux system.

Conclusion

Linux distributions are a great way to experience the power and flexibility of Linux. With so many different distributions to choose from, there is a distribution that is perfect for everyone.

What type of components might be different from one Linux distribution to another? Select three answers.

Their parent distributions, Their pre-installed programs, Their user interfaces

The pre-installed programs, user interfaces, and parent distributions might differ from one Linux distribution to another.

Let’s learn a little bit
more about Linux and what you need to know about this operating
system when working as a security analyst. Linux is a very customizable
operating system. Unlike other operating systems,
there are different versions available for you to use. These different versions of
Linux are called distributions. You might also hear them called
distros or flavors of Linux. It’s essential for you to understand
the distribution that you’re using so you know what tools and
apps are available to you. For example, Debian is a distro that has different
tools than the Ubuntu distribution. Let’s use an analogy to
describe Linux distributions. Think of the OS as a vehicle. First, we’ll start with its engine—that
would be the kernel. Just as the engine makes a vehicle run, the kernel is the
most important component of the Linux OS. Because the Linux kernel is open source,
anyone can take the kernel and modify it to build a new distribution. This is comparable to a vehicle
manufacturer taking an engine and creating different types of vehicles:
trucks, cars, vans, convertibles,
busses, airplanes, and so on. These different types of vehicles can be
compared to different Linux distributions. A bus is used to transport lots of people. A truck is used to transport a large
number of goods across vast distances. An aircraft transports
passengers or goods by air. Just as each vehicle
serves its own purpose, different distributions are used for
different reasons. Additionally, vehicles all have different
components which distinguish them from each other. Aircrafts have control panels
with buttons and knobs. Regular cars have four tires,
but trucks can have more. Similarly, different Linux distributions
contain different preinstalled programs, user interfaces, and much more. A lot of this is based on
what the Linux user needs, but some distros are also
chosen based on preference—the same way a sports car
might be chosen as a vehicle. The advantage of using Linux as
an OS is that you can customize it. Distributions include the Linux kernel,
utilities, a package management system, and
an installer. We learned earlier that
Linux is open source, and anyone can contribute to
adding to the source code. That is how new distributions are created. All distros are derived
from another distro, but there are a few that are considered
parent distributions. Red Hat® is the parent of CentOS, and
Slackware® is the parent of SUSE®. Both Ubuntu and
KALI LINUX™ are derived from Debian. As we continue, we’re going to take a look
at some of the distributions most commonly used by security analysts. The more you understand
these distributions, the easier your work will be.

Video: KALI LINUX ™

In this section, we will cover the Linux distribution Kali Linux™, which is widely used in security. Kali Linux™ is a Debian-derived distribution specifically made for penetration testing and digital forensics. It comes with many pre-installed tools, such as Metasploit, Burp Suite, and John the Ripper, which are useful for penetration testing and digital forensic work.

Key takeaways:

  • Kali Linux™ is a Linux distribution specifically made for penetration testing and digital forensics.
  • It comes with many pre-installed tools that are useful for these tasks.
  • Kali Linux™ should be used on a virtual machine to prevent damage to your system.

Image:

Next steps:

Explore other Linux distributions that are widely used in security.

What is Kali Linux?

Kali Linux is a Debian-based Linux distribution designed for digital forensics and penetration testing. It is freely available and includes numerous tools that are commonly used by security professionals, such as Metasploit, Nmap, and Wireshark.

Why use Kali Linux?

Kali Linux is a popular choice for security professionals because it is:

  • Comprehensive: Kali Linux comes with a wide range of pre-installed tools for penetration testing and digital forensics. This makes it a one-stop shop for security professionals, saving them time and effort.
  • Customizable: Kali Linux is highly customizable, allowing users to install and configure only the tools they need.
  • Free and open source: Kali Linux is free and open source software, which means that anyone can use it, modify it, and distribute it. This makes it a good choice for organizations of all sizes and budgets.

How to install Kali Linux

To install Kali Linux, you will need a bootable USB drive or DVD. You can create a bootable USB drive using a tool such as Rufus.

Once you have a bootable USB drive, you can boot your computer from the USB drive. This will start the graphical installer for Kali Linux.

The graphical installer will guide you through the installation process. You will need to choose a language, keyboard layout, and partition scheme. You will also need to create a user account.

Once the installation is complete, you will be able to log in to your new Kali Linux system.

Getting started with Kali Linux

Once you have logged in to your Kali Linux system, you should start by getting familiar with the pre-installed tools. You can do this by browsing the Kali Linux documentation or by searching the web for tutorials.

To start using Kali Linux for penetration testing or digital forensics, you will need to choose the right tools for the job. There are many different resources available online to help you choose the right tools for your needs.

Here are a few examples of popular Kali Linux tools:

  • Metasploit: Metasploit is a penetration testing framework that can be used to exploit vulnerabilities in systems and networks.
  • Nmap: Nmap is a port scanner that can be used to identify open ports on a system or network.
  • Wireshark: Wireshark is a network traffic analyzer that can be used to capture and analyze network traffic.
  • John the Ripper: John the Ripper is a password cracker that can be used to crack weak passwords.
  • Autopsy: Autopsy is a digital forensics tool that can be used to analyze hard drives and smartphones.

These are just a few examples of the many tools that are included with Kali Linux. For a more comprehensive list of tools, please see the Kali Linux documentation.

Conclusion

Kali Linux is a powerful tool for penetration testing and digital forensics. It is a popular choice for security professionals of all skill levels. If you are interested in learning more about penetration testing or digital forensics, I encourage you to download and install Kali Linux.

Image:

Next steps:

  • Learn more about the pre-installed tools on Kali Linux by browsing the Kali Linux documentation or searching the web for tutorials.
  • Choose the right tools for the job you need to do.
  • Start using Kali Linux for penetration testing or digital forensics.
Which of the following statements accurately describe the KALI LINUX ™ distribution? Select all that apply.
  • It contains many pre-installed tools that can be used for cybersecurity tasks.
  • It should be used on a virtual machine.
  • It is derived from Debian.

KALI LINUX ™ is a Debian-derived distribution, it contains many pre-installed tools for cybersecurity tasks, and it should be used on a virtual machine. It is an open-source distribution.

In this section, we’re going to cover
a Linux distribution that’s widely used in security and discuss KALI LINUX™. KALI LINUX™ is a trademark of Offensive
Security and is Debian derived. This open-source distro was made
specifically with penetration testing and digital forensics in mind. There are many tools
pre-installed into KALI LINUX™. It’s important to note that KALI LINUX™
should be used on a virtual machine. This prevents damage to your system in
the event its tools are used improperly. An additional benefit is that using
a virtual machine gives you the ability to revert to a previous state. As security professionals advance in their careers,
some specialize in penetration testing. A penetration test is a simulated attack
that helps identify vulnerabilities in systems, networks, websites,
applications, and processes. KALI LINUX™ has numerous tools that
are useful during penetration testing. Let’s look at a few examples. To begin, Metasploit can be used to look for and
exploit vulnerabilities on machines. Burp Suite is another tool that helps to
test for weaknesses in web applications. And finally, John the Ripper is
a tool used to guess passwords. As a security analyst, your work
might involve digital forensics. Digital forensics is
the process of collecting and analyzing data to determine what
has happened after an attack. For example, you might take an investigative look
at data related to network activity. KALI LINUX™ is also
a useful distribution for security professionals who
are involved in digital forensic work. It has a large number of tools that
can be used for this. As one example, tcpdump is a command-line packet analyzer.
It’s used to capture network traffic. Another tool commonly used in
the security profession is Wireshark. It has a graphical user interface
that can be used to analyze live and captured network traffic. And as a final example, Autopsy is a forensic tool used to
analyze hard drives and smartphones. These are just a few tools
included with KALI LINUX™. This distribution has many tools used to
conduct pen testing and digital forensics. We’ve explored how KALI LINUX™ is
an important distribution that’s widely used in security, but there are other distributions that
security professionals use as well. Next we’ll explore a few
more distributions.

Reading: More Linux distributions

Reading

Reading: Package managers for installing applications

Reading

Reading: Resources for completing Linux labs

Reading: Lab tips and troubleshooting steps

Reading

Practice Quiz: Test your knowledge: Linux distributions

Fill in the blank: Because the _____ is open source, anyone can modify it to build new Linux distributions.

What is KALI LINUX ™?

What is an open-source, user-friendly distribution derived from Debian that is widely used in security and other industries?

Which of the following are distributions of Linux? Select all that apply.

The shell


Video: Introduction to the shell

The Linux shell is a command-line interpreter that allows users to communicate with the operating system. It is the primary interface for security analysts to interact with Linux systems. The shell provides a command-line interface that allows users to enter commands to tell the operating system what to do. The shell communicates with the kernel to execute these commands. The shell is a powerful tool that allows users to perform a wide range of tasks, including running tests, executing applications, and performing complex and automated tasks.

Introduction to the Shell

The shell is a command-line interpreter that allows users to communicate with the operating system. It is the primary interface for security analysts to interact with Linux systems. The shell provides a command-line interface (CLI) that allows users to enter commands to tell the operating system what to do. The shell communicates with the kernel to execute these commands.

Benefits of using the shell

There are several benefits to using the shell, including:

  • Efficiency: The shell is a very efficient way to interact with the operating system. Commands can be typed quickly and easily, and the results are displayed immediately.
  • Power: The shell provides a wide range of commands that can be used to perform a variety of tasks, including system administration, file management, and software development.
  • Flexibility: The shell is very flexible and can be customized to meet the specific needs of the user.

Getting started with the shell

To get started with the shell, you will need to open a terminal window. A terminal window is a window that provides access to the shell. To open a terminal window, press Ctrl+Alt+T on most Linux distributions.

Once you have opened a terminal window, you can start typing commands. To execute a command, simply type it in the terminal window and press Enter.

Some basic shell commands

Here are some basic shell commands:

  • ls: List the contents of the current directory.
  • cd: Change directory.
  • pwd: Print working directory.
  • mkdir: Create a new directory.
  • rmdir: Remove a directory.
  • touch: Create a new file.
  • rm: Remove a file.
  • cat: Display the contents of a file.
  • grep: Search for a pattern in a file.
  • man: Display the manual page for a command.

Shell scripting

Shell scripting is the process of writing scripts that can be executed by the shell. Shell scripts are typically used to automate tasks. To create a shell script, simply create a new file with a .sh extension and add your commands to the file.

Once you have created a shell script, you can execute it by typing the following command:

sh <script_name>

For example, to execute a shell script called my_script.sh, you would type the following command:

sh my_script.sh

Conclusion

The shell is a powerful tool that can be used to perform a wide range of tasks. It is the primary interface for security analysts to interact with Linux systems. If you are new to Linux, I encourage you to learn how to use the shell. It is a valuable skill that will make you more productive and efficient.

Here are some additional tips for learning the shell:

  • Start by learning the basic shell commands.
  • Experiment with the shell and try different commands.
  • Read the man pages for the commands that you use frequently.
  • Write shell scripts to automate your tasks.
  • Find a good shell scripting tutorial or book.

With a little effort, you can learn how to use the shell effectively.

What is the purpose of the shell?

It helps humans and computers communicate with each other.

The shell helps humans and computers communicate with each other. It is the command-line interpreter and helps humans communicate with the operating system through the command line.

Welcome back! In this video, we’re
going to discuss the Linux shell. This part of the Linux architecture
is where the action will happen for you as a security analyst. We introduced the shell with other
components of the Linux OS earlier, but let’s take a deeper look at
what the shell is and what it does. The shell is the command-line interpreter. That means it helps you communicate
with the operating system through the command line. Previously, we discussed
a command-line interface. This is essentially the shell. The shell provides the command-line
interface for you to interact with the OS. To tell the OS what to do, you enter
commands into this interface. A command is an instruction telling
the computer to do something. The shell communicates with
the kernel to execute these commands. Earlier, we discussed how
the operating system helps humans and computers speak with each other. The shell is the part of the OS
that allows you to do this. Think of this as a very helpful language
interpreter between you and your system. Since you do not speak
computer language or binary, you can’t directly
communicate with your system. This is where the shell
comes in to help you. Your OS doesn’t need the shell for
most of its work, but it is an interface between you and
what your system can offer. It allows you to perform math,
run tests, and execute applications. More importantly, it allows you
to combine these operations and connect applications to each other to perform complex and automated tasks. Just as there are many
Linux distributions, there are many different types of shells. We’ll primarily focus on
the Bash shell in this course. Let’s continue to learn
more about the shell.

Reading: Different types of shells

Reading

Video: Input and output in the shell

Communication with the shell can be divided into three parts: standard input, standard output, and standard error.

  • Standard input is the information received by the OS via the command line.
  • Standard output is the information returned by the OS through the shell.
  • Standard error contains error messages returned by the OS through the shell.

Example:

echo hello

Output:

hello

Example:

eco hello

Output:

command not found: eco

The shell communicates with the kernel to execute commands. If the shell can interpret the command, it asks the kernel for the resources it needs to execute the related task. If the shell cannot interpret the command, it returns an error message.

Input and output in the shell

The shell is a command-line interpreter that allows users to communicate with the operating system. It is the primary interface for security analysts to interact with Linux systems. The shell provides a command-line interface (CLI) that allows users to enter commands to tell the operating system what to do. The shell communicates with the kernel to execute these commands.

Input and output redirection

Input and output redirection allows users to specify where the shell should read input from and send output to. This can be useful for a variety of reasons, such as piping the output of one command to the input of another command, or saving the output of a command to a file.

To redirect input, use the < operator. For example, to redirect the contents of the file my_file.txt to the input of the cat command, you would type the following command:

cat < my_file.txt

To redirect output, use the > operator. For example, to redirect the output of the ls command to the file my_file.txt, you would type the following command:

ls > my_file.txt

Piping

Piping allows you to connect the output of one command to the input of another command. This can be useful for automating complex tasks.

To pipe the output of one command to the input of another command, use the | operator. For example, to list the contents of the current directory and then search for the string “hello” in each file, you would type the following command:

ls | grep "hello"

This command will first list the contents of the current directory using the ls command. The output of the ls command will then be piped to the grep command, which will search for the string “hello” in each file. The output of the grep command will then be displayed on the screen.

Conclusion

Input and output redirection and piping are powerful tools that can be used to automate tasks and perform complex operations in the shell. By learning how to use these tools, you can make yourself a more efficient and productive shell user.

Here are some additional tips for using input and output redirection and piping:

  • Use the > operator to redirect output to a file.
  • Use the < operator to redirect input from a file.
  • Use the | operator to pipe the output of one command to the input of another command.
  • Use the tee command to redirect output to both a file and the screen.
  • Use the head and tail commands to view the first or last few lines of a file.
  • Use the sort command to sort the output of a command.
  • Use the uniq command to remove duplicate lines from the output of a command.

With a little practice, you can learn to use input and output redirection and piping to perform a wide range of tasks in the shell.

What can the shell return after a user types a command?

Standard output or standard error

After a user types a command into the shell, the shell can return either standard output or standard error. Standard output is information returned by the OS through the shell. Standard error contains error messages returned by the OS through the shell.

Hello again! In this video, we’re going to learn
a little more about the shell and how to
communicate with it. Communicating with a computer is like having a conversation
with your friend. One person asks a question and the other person
answers with a response. If you don’t know the answer, you can just say you
don’t know the answer. When you communicate
with the shell, the commands in the
shell can take input, give output, or give
error messages. Let’s explore standard input, standard output, and error
messages in more detail. Standard input consists
of information received by the OS
via the command line. This is like you
asking your friend a question during
a conversation. The information is input from
your keyboard to the shell. If the shell can
interpret your request, it asks the kernel
for the resources it needs to execute
the related task. Let’s take a look at
this through echo, a Linux command that outputs
a specified string of text. String data is data consisting of an ordered sequence
of characters. In our example, we’ll just have it output the string of: hello. So, as input, we’ll type: echo
hello into the shell. Later, when we press enter,
we’ll get the output. But before we do that, let’s first discuss the concept
of output in more detail. Standard output is
the information returned by the OS
through the shell. In the same way that your friend gives an answer
to your question, output is a computer’s response
to the command you input. Output is what you receive. Let’s pick up where we left
off in our example and send the input of: echo hello to
the OS by pressing enter. Immediately, the shell
returns the output of: hello. Finally, standard error contains error messages returned by
the OS through the shell. Just like your friend might indicate that they can’t
answer a question, the system responds with an error message if they can’t
respond to your command. Sometimes this might
occur when we misspell a command or the system doesn’t know the
response to the command. Other times, it might happen
because we don’t have the appropriate permissions
to perform a command. We’ll explore another example that demonstrates
standard error. Let’s input: eco hello
into the shell. Notice I intentionally
misspelled echo as e-c-o. When we press enter, an error message appears. To wrap up, we’ve covered the basics of communication
with the shell. Communication with the
shell can only go in one of three ways: the system receives a command—this is input; the system responds to the
command and produces output; and finally, the system
doesn’t know how to respond, resulting in an error. Later, you’ll become much
more familiar with this as we explore commands useful
for security professionals.

Practice Quiz: Test your knowledge: The shell

What is the shell?

After a user inputs a command into the shell, what can the shell return to the user? Select two answers.

What is standard error in Linux?

What is the difference between standard input and standard output?

Review: The Linux operating system


Video: Wrap-up

This section provided an overview of the Linux operating system, including its architecture, different distributions, and the shell.

Key takeaways:

  • Linux is a Unix-like operating system with a monolithic kernel.
  • Some of the most widely used Linux distributions for security include Kali Linux, Ubuntu, Parrot, Red Hat, and CentOS.
  • The shell is an interpreter between the user and the operating system.

The next section will cover specific shell commands that security analysts use.

We’ve made it to the
end of this section. Great work! Let’s recap what
you’ve just completed. In this section, you learned about the Linux
operating system. We examined the
architecture of Linux. In our exploration of the different
distributions of Linux, we discussed some of the most widely used distros in security. You were introduced to
KALI LINUX™, Ubuntu, Parrot, Red Hat, and
CentOS distributions. Finally, you learned
about the shell and its role as an interpreter between the user and
operating system. Congratulations! You’re doing great, and we have more
useful topics to come. In the next part of the program, you’ll learn specific
commands to use within the shell while working as a security analyst.
Let’s continue on.

Reading: Glossary terms from module 2

Terms and definitions from Course 4, Module 2

Quiz: Module 2 challenge

Fill in the blank: Linux is a(n) _____ operating system.

Which of the following components are part of the Linux architecture? Select all that apply.

Which of the following are examples of Linux distributions? Select all that apply.

What is KALI LINUX ™? (KALI LINUX ™ is a trademark of OffSec.)

Which of these Linux distributions come with pre-installed tools related to penetration testing and digital forensics? Select two answers.

What is the shell in Linux?

If you enter echo cybersecurity into the command line, what is the output?

Which of the following is an example of an application?

What is standard input?