Skip to main content

Linux Essentials for Cybersecurity, 1st edition William Rothwell Solution Manual

Page 1

Type:

Solution Manual

Resource:

Linux Essentials for Cybersecurity

Edition:

1st Edition

Author(s):

William Rothwell Denise Kinsey


INSTRUCTOR’S GUIDE TO ACCOMPANY LINUX ESSENTIALS FOR CYBERSECURITY CHAPTER 1 DISTRIBUTIONS AND KEY COMPONENTS CHAPTER OBJECTIVES When students have finished reading this chapter and completing the exercises, they will be able to do the following: • • • •

Describe the various parts of Linux Identify the major components that make up the Linux operating system Describe different types of Linux distributions Identify the steps for installing Linux

CHAPTER OVERVIEW In this first chapter, you learn about some of the essential concepts of Linux. You discover what a distribution is and how to pick a distribution that best suits your needs. You are also introduced to the process of installing Linux, both on a bare-metal system and in a virtual environment.

CHAPTER OUTLINE 1.

2.

Introducing Linux a. Linux Distributions b. Shells c. GUI Software Installing Linux a. Which Distro? b. Native or Virtual Machine? c. Installing a Distro

SUGGESTED CLASS STRUCTURE During class, lead a discussion of the chapter’s concepts using the PowerPoint presentation provided in the instructor materials. The PowerPoint slides provide some basic facts and topics, but you will want to supplement this information with information from the textbook and other resources and with stories from your own experience. End with the Key Terms review, the Review Questions quiz, and one or more of the corresponding lab exercises.

TEACHING NOTES AND TIPS PER TOPIC 1.

Introducing Linux


Teaching Note: This section introduces Linux by providing some basic information about its structure and interfaces. It includes a discussion of command-line shells and GUI interfaces. Review the descriptions of each component on page 5. Teaching Tip: Use Figure 1-1 as a starting point for discussing the components that make up Linux and their relationship to the kernel. Point out that not all the components in Figure 1-1 are essential. Teaching Tip: Differentiate between the common distribution types using the bulleted list on page 6, including commercial, home/amateur, security-enhanced, and live. Ask students to name some other types of distros. These could include education, young learners, beginners, gaming, and older computers. Teaching Note: Even though technically a shell can be any user interface, in Linux it typically refers to a command-line interface, or CLI. Some of the most popular shells are BASH and Bourne. Note that BASH is the shell used in this book in most cases. 2.

Installing Linux Teaching Note: This section guides students through the process of selecting a distro, deciding where to install it, and performing the installation. Teaching Tip: Note that many of the most popular distros fall into one of two categories: Red Hat-based or Debian-based. Ask students to name as many different distros in each of these categories as they can, making a list on the board. Teaching Tip: Discuss whether or not virtual machines are more secure than bare-metal installations. The Security Highlight box on page 9 brings up some points for conversation. Teaching Tip: If students are going to create VMs for multiple versions of Linux for this class, walk them through the process of setting up VirtualBox and installing their first VM; then have them create the additional VMs they need for this class on their own.

ACTIVITIES FOR CLASS I.

Discussion Topics Question 1: What are the advantages and disadvantages of a CLI? Answer 1: Advantages: more powerful, more commands and functions. Easier and quicker for experienced users. Can be more secure. Consumes fewer system resources. Disadvantages: Higher learning curve for newer users, not as enjoyable to use for most people. Question 2: When studying Linux, as you will do in this book, what are the pros and cons of using a VM vs a native installation? Answer 2: A VM may be a better choice for study because you can have several different distros and switch between them easily. However, if it is a very old computer without much CPU and RAM, the strain of running a hypervisor and a VM may make it run more slowly than if you installed Linux natively.

II.

Exercises and Activities Lab Exercises: Assign one or more of the following lab exercises: 1.1 Installing CentOS


1.2 Installing Ubuntu 1.3 Installing Kali Web Search Exercise: The textbook mentions that using a GUI can pose a security risk. Why is this so? One reason is that every time you add more software to the system, you add a potential security risk. Find some articles that discuss this topic and write a summary of the opinions and reasonings you discover. Review Key Terms: Review these terms from the chapter. If desired, you can create a matching exercise from these words, matching the terms to their definitions. • • • • • • • • • • •

Kernel Shell File system Kernel modules Libraries Distribution Distro CLI GUI Virtual machine VM

WEB RESOURCES DistroWatch: https://distrowatch.com VirtualBox: https://www.virtualbox.org CentOS download: https://www.centos.org/download Fedora download: https://getfedora.org Red Hat Enterprise Linux: https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux Ubuntu download: https://ubuntu.com/download Kali download: https://www.kali.org/downloads Mint download: https://linuxmint.com/download.php Debian download: https://www.debian.org/distrib

uCertify If you are using the uCertify course and labs product, be sure to review the associated online labs for this chapter. Students can do these labs as homework or during class time for hands-on practice to reinforce core learning objectives.


INSTRUCTOR’S GUIDE TO ACCOMPANY LINUX ESSENTIALS FOR CYBERSECURITY CHAPTER 2 WORKING ON THE COMMAND LINE CHAPTER OBJECTIVES When students have finished reading this chapter and completing the exercises, they will be able to do the following: •

Manage files and directories

•

Use shell features such as shell variables

•

Be able to re-execute previous commands using the shell feature called history

•

Identify regular expressions and know how to use them with commands like find, grep, and sed

•

Manage file-compression utilities

CHAPTER OVERVIEW The goal of this chapter is to introduce you to some of the more essential command-line utilities. You learn commands used to manage files and directories, including how to view, copy, and delete files. You also learn the basics of a powerful feature called regular expressions, which allows you to view and modify files using patterns. This chapter introduces some of the more commonly used file-compression utilities, such as the tar and gzip utilities.

CHAPTER OUTLINE 1.

2.

File Management a. The Linux Filesystem b. Command Execution i. The pwd Command ii. The cd Command iii. The ls Command iv. File Globbing v. The file Command vi. The less Command vii. The head Command viii. The tail Command ix. The mkdir Command x. The cp Command xi. The mv Command xii. The rm Command xiii. The rmdir Command xiv. The touch Command Shell Features


3.

a. Shell Variables i. echo ii. set iii. unset iv. The PS1 Variable v. The Path Variable b. Environment Variables c. Initialization Files d. Alias e. Command History i. History Variables ii. The .bash_history File f. Redirecting Input and Output i. Piping ii. Subcommands Advanced Commands a. The find Command b. Regular Expressions c. The grep Command d. The sed Command e. Compression Commands i. The tar Command ii. The gzip Command iii. The gunzip Command iv. The bzip2 Command v. The xz Command

TEACHING NOTES AND TIPS PER TOPIC 1.

File Management Teaching Note: This section introduces the Linux file system and teaches some of the essential commandline tools for file management. Teaching Tip: The table of FHS locations on page 15 is important. Linux admins should have these locations memorized because doing so makes it so much easier to find the files they need in everyday usage. Consider making this table into a matching exercise for an in-class activity. Teaching Tip: Clarify the difference between options and arguments, as explained on page 16. Teaching Tip: Show in-class examples of each of the commands covered in this section: pwd, cd, ls, file, less, head, tail, mkdir, cp, mv, rm, rmdir, and touch. Teaching Tip: Students may not recognize the term “file glob” but they have probably used one. It is what Windows and some other OSes call wildcards. Besides the common * and ? globs, Linux has the [ ] brackets. Show how each of these three work.

2.

Shell Features Teaching Note: This section shows some of the BASH shell features that you can use to customize your working environment.


Teaching Tip: Review Table 2-10 on pages 22-23 and discuss each of these shell variables. Then, show how to combine them with the echo command to display the values stored in variables. Teaching Tip: Explain how the order in which the OS looks for a particular command is based on the path variable. Show what happens when you have two different versions of the same executable, located in two different places. Based on the order of the directories in the path, it may encounter and run one or the other first. Teaching Tip: Point out that an alias is a shortcut for running a certain command with certain options and variables. Review the examples in Example 2-1 on page 28. Teaching Tip: Demonstrate how to write the command history to .bash_history using the -w option. Demonstrate how to execute a command in the history by using the ! followed by the command number. Reference Table 2-14 on page 29 for other techniques to use with the history command. Teaching Tip: Explain how to redirect input and output using cmd and using piping. Point out the pipe symbol on your keyboard, and if there are other keyboards in the classroom, ask students to find it on their own keyboard, as its location can vary. 3.

Advanced Commands Teaching Note: This section covers some of the more advanced commands that users are likely to want to use on a regular basis. It is not a comprehensive reference by any means; point students to online references that are more complete. Teaching Tip: Demonstrate several uses of the find command, using the options in Tables 2-17 through 219. Differentiate between find and grep. Teaching Tip: Define regular expression, or regex. Review the entries in Table 2-20 and 2-21. Show the find command’s support of the -regexp option to use regular expression to perform pattern matching of the filename. Teaching Tip: Review the sed command, covered on page 37. Ask students to think about how a hacker could use this command. Teaching Tip: Ask students about their experiences with compressed archive files. The most common format on Windows PCs is ZIP, but the most common on Linux systems is tar. Demonstrate the tar command, using the examples and options on page 38. Compare it to gzip and gunzip, covered on page 39.

ACTIVITIES FOR CLASS I.

Discussion Topics Question 1: What are the similarities and differences between the Linux command line interface, which is based on Unix, and the Windows command line interface, which is based on DOS? Answer 1: There are many possible answers. Students may name some commands that are different or the same in each shell. They might mention that Linux is case-sensitive, and Windows is not. They might mention the different disk filesystems. They might bring up the FHS locations in Linux.


Question 2: The history command is useful for recalling recently used commands from the shell, but it can also play a role in security. How so? Answer 2: The history command could be used to see what has been recently done from the command line on that computer, which could be useful for someone snooping, but also useful for someone trying to follow the trail of a hacker. II.

Exercises and Activities Lab Exercises: Assign one or more of the following lab exercises: 2.1 Manage files 2.2 Using shell features 2.3 Compressing files Web Search Exercise: Find at least three comprehensive Linux command references online. Which do you think is better and why? Which ones will you bookmark for later personal use? Present your findings to the class. Review Key Terms: Review these terms from the chapter. If desired, you can create a matching exercise from these words, matching the terms to their definitions. current directory

root directory

parent directory

subdirectory

child directory

Filesystem Hierarchy Standard

option

argument

absolute path

relative path

file glob

wildcard

variable

local variable

environment variable

login shell

non-login shell

initialization file

alias

redirection

piping

subcommand

regular expression

WEB RESOURCES Linux Basic Shell Reference Guide: http://www.penguintutor.com/linux/basic-shell-reference 20 Linux Commands Every Sysadmin Should Know: https://opensource.com/article/17/7/20-sysadmin-commands A to Z Linux Commands: https://www.tecmint.com/linux-commands-cheat-sheet/ Linux Command Line Reference: http://www.pixelbeat.org/cmdline.html

uCertify If you are using the uCertify course and labs product, be sure to review the associated online labs for this chapter. Students can do these labs as homework or during class time for hands-on practice to reinforce core learning objectives.


INSTRUCTOR’S GUIDE TO ACCOMPANY LINUX ESSENTIALS FOR CYBERSECURITY CHAPTER 3 GETTING HELP CHAPTER OBJECTIVES When students have finished reading this chapter and completing the exercises, they will be able to do the following: • • •

Discover information about commands by using specific command-line options Get help about a command, feature, or configuration file by using man or info pages Use additional documentation on the system to solve problems

CHAPTER OVERVIEW Linux comes with a great help system. Almost every command, feature, configuration file, and service has enough documentation to help you when your brain refuses to recall that important option, setting, or value. In this chapter, you learn how to make use of this documentation.

CHAPTER OUTLINE 1. Man Pages a. Man Page Components b. Man Page Sections c. Man Page Locations 2. Command Help Options 3. The help Command 4. The info Command 5. The usr/share/doc Directory 6. Internet Resources

TEACHING NOTES AND TIPS PER TOPIC 1. Man Pages Teaching Note: This section defines man pages and shows how to access them, including movement commands, components, sections, and locations. Teaching Tip: Refer students to Table 3-1 for some movement commands that work in a man page. Discuss how navigation in a man page is different from navigation in a graphical text editor such as Notepad in Windows. Teaching Tip: Use Figure 3-1 to point out the components of a man page, and refer to Table 3-2 to describe each of the components. Differentiate between components and sections, and use Figure 3-2 and


Table 3-3 to discuss sections. Demonstrate the use of the -f option to show the section names. Note that the man -f command is the same as the whatis command. Teaching Tip: Demonstrate how to access a man page that is not in a standard location and show how to create a MANPATH variable. 2. Command Help Options Teaching Note: This section shows how to get help with the syntax of a command. Teaching Tip: Note that when using the help option, it is preceded by two minus signs: --help. However, a few commands use -h instead of --help. Teaching Note: If you are using Microsoft Word to create quizzes or other learning materials for this chapter, be aware that Word automatically changes two minus signs (--) to a long dash (—) as you type. 3. The help Command Teaching Note: This section explains how to use the help command to get help on built-in shell commands. Teaching Tip: Explain the difference between a built-in shell command and an external command with a separate executable and provide some examples. Teaching Tip: Point out Example 3-4 on page 47, which demonstrates using help -s to get a list of built-in commands. Teaching Tip: Mention that it is not important to memorize which commands are shell commands and which aren’t; if man doesn’t work for getting help for a command, you can quickly use the help command. 4. The info Command Teaching Note: This section explains info pages and differentiates them from man pages. Teaching Tip: Use Figure 3-3 to show how an info page is different from a man page. For one thing, there are hyperlinks. Teaching Tip: Point out the movement commands for the info command in Table 3-4 and compare them to the movement commands for the man command back in Table 3-1. 5. The usr/share/doc Directory Teaching Note: This section introduces the /usr/share/doc directory, where additional documentation may be available, depending on what software has been installed. Teaching Tip: Point out that, as shown in Example 3-5 on page 48, the /usr/share/doc directory contains subdirectories for the various installed applications. 6. Internet Resources Teaching Note: This section discusses the availability of Internet resources to help students get information about Linux commands and their syntax and usage.


ACTIVITIES FOR CLASS I.

Discussion Topics Question 1: Why would an application developer choose to provide info pages instead of man pages? Answer 1: Info pages provide more capabilities, such as the ability to include hyperlinks to create a linked set of page documents, rather than having to put everything in a single document. Question 2: Why are there no man pages for built-in shell commands? Answer 2: Because there are no separate executable files for these commands, so there is no command file to associate a man page with. Man pages accompany executables.

II.

Exercises and Activities Lab Exercises: Assign one or more of the following lab exercises: • •

3.1 Getting help with man 3.2 Getting help with info

Web Search Exercise: Find documentation online that was not referenced in this chapter for at least two different shells and two different distros. Write a one-paragraph review of each site you found. Review Key Terms: Review these terms from the chapter. • •

man page info page

WEB RESOURCES Red Hat Enterprise Linux guide: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux GNUSoftware Foundation gzip manual: https://www.gnu.org/software/gzip/manual/gzip.html The Linux Documentation Project: http://www.tldp.org Linux Today: www.linuxtoday.com Linux Forums: http://www.linuxforums.org

uCertify If you are using the uCertify course and labs product, be sure to review the associated online labs for this chapter. Students can do these labs as homework or during class time for hands-on practice to reinforce core learning objectives.


Turn static files into dynamic content formats.

Create a flipbook
Linux Essentials for Cybersecurity, 1st edition William Rothwell Solution Manual by TBtutors - Issuu