InstructorGuides - RH134 RHEL9.0 en 2 20220609 IG
InstructorGuides - RH134 RHEL9.0 en 2 20220609 IG
InstructorGuides - RH134 RHEL9.0 en 2 20220609 IG
The contents of this course and all its modules and related materials, including handouts to audience members, are
Copyright © 2022 Red Hat, Inc.
No part of this publication may be stored in a retrieval system, transmitted or reproduced in any way, including, but
not limited to, photocopy, photograph, magnetic, electronic or other record, without the prior written permission of
Red Hat, Inc.
This instructional program, including all material provided herein, is supplied without any guarantees from Red Hat,
Inc. Red Hat, Inc. assumes no liability for damages or legal action arising from the use or misuse of contents or details
contained herein.
If you believe Red Hat training materials are being used, copied, or otherwise improperly distributed, please send
email to [email protected] or phone toll-free (USA) +1 (866) 626-2994 or +1 (919) 754-3700.
Red Hat, Red Hat Enterprise Linux, the Red Hat logo, JBoss, OpenShift, Fedora, Hibernate, Ansible, CloudForms,
RHCA, RHCE, RHCSA, Ceph, and Gluster are trademarks or registered trademarks of Red Hat, Inc. or its subsidiaries
in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
XFS® is a registered trademark of Hewlett Packard Enterprise Development LP or its subsidiaries in the United
States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is a trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open
source or commercial project.
The OpenStack word mark and the Square O Design, together or apart, are trademarks or registered trademarks
of OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's
permission. Red Hat, Inc. is not affiliated with, endorsed by, or sponsored by the OpenStack Foundation or the
OpenStack community.
Contributors: Adarsh Krishnan, David Sacco, Hemant Chauhan, Roberto Velazquez, Sajith
Eyamkuzhy, Samik Sanyal, Yuvaraj Balaraju
Document Conventions ix
.............................................................................................................................. ix
Course Timing xi
ILT ....................................................................................................................
VLT ...................................................................................................................
Course Introduction xv
Student Benefits ..................................................................................................... xv
Presentation Notes ................................................................................................. xvi
1. Improve Command-line Productivity 1
Chapter Information ............................................................................................
Chapter Schedule ...............................................................................................
Chapter Objectives ................................................................................................... 2
Key Takeaways ......................................................................................................... 2
Instructor Tips and Suggestions .................................................................................. 2
2. Schedule Future Tasks 5
Chapter Information ............................................................................................
Chapter Schedule ...............................................................................................
Chapter Objectives ................................................................................................... 6
Key Takeaways ......................................................................................................... 6
Instructor Tips and Suggestions ................................................................................. 6
3. Tune System Performance 9
Chapter Information ............................................................................................
Chapter Schedule ...............................................................................................
Chapter Objectives .................................................................................................. 10
Key Takeaways ........................................................................................................ 10
Instructor Tips and Suggestions ................................................................................ 10
4. Manage SELinux Security 13
Chapter Information ............................................................................................
Chapter Schedule ...............................................................................................
Chapter Objectives .................................................................................................. 14
Key Takeaways ........................................................................................................ 14
Instructor Tips and Suggestions ................................................................................. 14
5. Manage Basic Storage 17
Chapter Information ............................................................................................
Chapter Schedule ...............................................................................................
Chapter Objectives .................................................................................................. 18
Key Takeaways ........................................................................................................ 18
Instructor Tips and Suggestions ................................................................................. 18
6. Manage Storage Stack 21
Chapter Information ............................................................................................
Chapter Schedule ...............................................................................................
Chapter Objectives ................................................................................................. 22
Key Takeaways ........................................................................................................ 22
Instructor Tips and Suggestions ................................................................................ 22
7. Access Network-Attached Storage 25
Chapter Information ............................................................................................
Chapter Schedule ...............................................................................................
Chapter Objectives ................................................................................................. 26
Key Takeaways ....................................................................................................... 26
Instructor Tips and Suggestions ................................................................................ 26
RH134-RHEL9.0-en-2-20220609 vii
8. Control the Boot Process 29
Chapter Information ............................................................................................
Chapter Schedule ...............................................................................................
Chapter Objectives ................................................................................................. 30
Key Takeaways ....................................................................................................... 30
Instructor Tips and Suggestions ............................................................................... 30
9. Manage Network Security 33
Chapter Information ............................................................................................
Chapter Schedule ...............................................................................................
Chapter Objectives ................................................................................................. 34
Key Takeaways ....................................................................................................... 34
Instructor Tips and Suggestions ................................................................................ 34
10. Install Red Hat Enterprise Linux 37
Chapter Information ............................................................................................
Chapter Schedule ...............................................................................................
Chapter Objectives ................................................................................................. 38
Key Takeaways ....................................................................................................... 38
Instructor Tips and Suggestions ................................................................................ 38
11. Run Containers 41
Chapter Information ............................................................................................
Chapter Schedule ...............................................................................................
Chapter Objectives ................................................................................................. 42
Key Takeaways ....................................................................................................... 42
Instructor Tips and Suggestions ................................................................................ 43
12. Comprehensive Review 45
Chapter Information ............................................................................................
Chapter Schedule ...............................................................................................
Chapter Objectives ................................................................................................. 46
Key Takeaways ....................................................................................................... 46
Instructor Tips and Suggestions ................................................................................ 46
viii RH134-RHEL9.0-en-2-20220609
Document Conventions
This section describes various conventions and practices used throughout all
Red Hat Training courses.
Admonitions
Red Hat Training courses use the following admonitions:
References
These describe where to find external documentation relevant to a
subject.
Note
These are tips, shortcuts, or alternative approaches to the task at hand.
Ignoring a note should have no negative consequences, but you might
miss out on something that makes your life easier.
Important
These provide details of information that is easily missed: configuration
changes that only apply to the current session, or services that need
restarting before an update will apply. Ignoring these admonitions will
not cause data loss, but may cause irritation and frustration.
Warning
These should not be ignored. Ignoring these admonitions will most likely
cause data loss.
Inclusive Language
Red Hat Training is currently reviewing its use of language in various areas
to help remove any potentially offensive terms. This is an ongoing process
and requires alignment with the products and services covered in Red Hat
Training courses. Red Hat appreciates your patience during this process.
RH134-RHEL9.0-en-2-20220609 ix
x RH134-RHEL9.0-en-2-20220609
Course Timing
ILT
Day 1
Activity Time
Chapter 3 90 minutes
Day 2
Activity Time
Chapter 6 55 minutes
Day 3
Activity Time
Chapter 6 70 minutes
Day 4
Activity Time
RH134-RHEL9.0-en-2-20220609 xi
Course Timing
Activity Time
Chapter 11 80 minutes
Day 5
Activity Time
VLT
Day 1
Activity Time
Chapter 3 90 minutes
Day 2
Activity Time
Chapter 6 55 minutes
Day 3
Activity Time
Chapter 6 70 minutes
xii RH134-RHEL9.0-en-2-20220609
Course Timing
Activity Time
Day 4
Activity Time
Chapter 11 80 minutes
Day 5
Activity Time
RH134-RHEL9.0-en-2-20220609 xiii
xiv RH134-RHEL9.0-en-2-20220609
Course Introduction
Welcome students and provide an orientation to the class, classroom
hardware, and facility or VT environment.
Student Benefits
This course is specifically designed for students who have completed
Red Hat System Administration I (RH124). Red Hat System Administration
II (RH134) focuses on the key tasks needed to become a full time Linux
Administrator and to validate those skills via the Red Hat Certified System
Administrator exam. This course goes deeper into Enterprise Linux
administration including filesystems and partitioning, logical volumes,
SELinux, firewalling, troubleshooting, and containers.
RH134-RHEL9.0-en-2-20220609 xv
Course Introduction
Presentation Notes
Introduce yourself and welcome students to the class. Before starting make sure any operational
requirements, including taking attendance and providing students with materials, have been
met. For an in-person training event, orient students to the facility. Make sure students know the
classroom hours and plans for any rest breaks and lunch.
Discuss the basic structure of the course and course timing with the students.
Objectives
Introduce your students to the main objectives of this course.
xvi RH134-RHEL9.0-en-2-20220609
Chapter 1
Improve Command-line
Productivity
This chapter reviews running command more efficiently by using advanced
features of the Bash shell, shell scripts, and various Red Hat Enterprise Linux
utilities.
Chapter Schedule
ILT/VT Schedule
Introduction 3
A: Guided Exercise 10
Conclusion 2
RH134-RHEL9.0-en-2-20220609 1
Chapter 1 | Improve Command-line Productivity
Chapter Objectives
By the end of this chapter, students should be able to:
• Run commands more efficiently by using advanced features of the Bash shell, shell scripts, and
various Red Hat Enterprise Linux utilities.
• Run repetitive tasks with for loops, evaluate exit codes from commands and scripts, run tests
with operators, and create conditional structures with if statements.
• Create regular expressions to match data, apply regular expressions to text files with the grep
command, and use grep to search files and data from piped commands.
Key Takeaways
Key takeaways from this chapter include the following:
• Create and execute simple Bash scripts to accomplish simple administration tasks.
• Use loops to iterate through a list of items from the command line and in a shell script.
• Search for text in log and configuration files by using regular expressions and the grep
command.
• The two sections on scripting are short, with the intent that they be a refresher for some, and a
reminder to others that scripting remains a critical, simple glue for so many ad-hoc daily tasks.
Simple looping and conditional logic, and the ability to pass parameters, allows an admin to
quickly perform an action across multiple files, or similar.
• Make it sound really important, but don't spend a lot of time here. Remind students that there
are so many resources out there to learn scripting skills.
2 RH134-RHEL9.0-en-2-20220609
Chapter 1 | Improve Command-line Productivity
• Regular expression are another critical skill. Humorously, that fact syncs in with students after
a couple of successes with what appears at first to be difficult syntax. Remind students that,
in the hands of someone with just a little diligence, regular expressions can process exactly
the records you want. "All these, and some of those but not when those also have this." It is an
epiphany when the system admin realizes how many commands and tools out there support
regular expressions, and notices that language and syntax is pretty much consistent everywhere.
Which means that learning regex skills transfers to many useful tools and tasks.
RH134-RHEL9.0-en-2-20220609 3
4 RH134-RHEL9.0-en-2-20220609
Chapter 2
Chapter Schedule
ILT/VT Schedule
Introduction 3
A: Guided Exercise 15
Conclusion 2
RH134-RHEL9.0-en-2-20220609 5
Chapter 2 | Schedule Future Tasks
Chapter Objectives
By the end of this chapter, students should be able to:
• Schedule commands to run on a repeating schedule with the system crontab file and
directories.
• Enable and disable systemd timers, and configure a timer that manages temporary files.
Key Takeaways
Key takeaways from this chapter include the following:
• Recurring system jobs accomplish, on a repeating schedule, administrative tasks that have
system-wide impact.
• The systemd timer units can execute both the deferred and recurring jobs.
• Show students how to schedule a deferred job with at using two or three different time formats.
Also, show them how to inspect and manage deferred jobs.
2. The user cron is for recurring jobs for a single person, and it is really important for users to
understands that the crontab editing method is really the only way to do this.
6 RH134-RHEL9.0-en-2-20220609
Chapter 2 | Schedule Future Tasks
3. The system cron is neither of the above. Instead, this is about system administration, and
things that must be automated on a single system using simple scripting and systemd.
• Show students the use of the crontab command with its various options such as -l, -e, and -
r. Take an example of a user cronjob and explain the job format of the user cronjob. Ensure that
the students understand the meaning of each field in the user job format.
• Mention the challenge that comes with scheduling a recurring job using crontab and that
the crond daemon expects the system to be fully up and running always to execute the
scheduled job. There may be situations where a system may not be fully up which would cause
the scheduled job to fail. This is why the critical system administrative jobs should be scheduled
as system jobs and not user jobs. Mention in the next section that they will learn how to schedule
a system job.
RH134-RHEL9.0-en-2-20220609 7
8 RH134-RHEL9.0-en-2-20220609
Chapter 3
Chapter Schedule
ILT/VT Schedule
Introduction 3
A: Guided Exercise 20
Conclusion 2
RH134-RHEL9.0-en-2-20220609 9
Chapter 3 | Tune System Performance
Chapter Objectives
By the end of this chapter, students should be able to:
• Optimize system performance by selecting a tuning profile that the tuned daemon manages.
• Prioritize or deprioritize specific processes, with the nice and renice commands.
Key Takeaways
Key takeaways from this chapter include the following:
• The tuned service automatically modifies device settings to meet specific system needs based
on a predefined selected tuning profile.
• To revert all changes of the selected profile to the system settings, either switch to another
profile or deactivate the tuned service.
• The system assigns a relative priority to a process to determine its CPU access. This priority is
called the nice value of a process.
• If students are curious to know how static tuning works you could explain that static tuning
uses the predefined sysctl and sysfs settings to adjust the systems behavior based on
various tuning profiles. The output of the sudo sysctl -a | less command will display the
numerous kernel parameters that are available and should be enough to convince students why
this subject matter requires a course of its own.
• Tuned has matured. It is much easier to teach what it does, and how it can be customized. Red
Hat has years of experience now with common scenarios, so it is fair to tell students that almost
all they will do with performance tuning will be to pick the most appropriate tuning profile.
10 RH134-RHEL9.0-en-2-20220609
Chapter 3 | Tune System Performance
• The new web console content for tuned is simple and mostly trivial, but your teaching point is
that "look at how many common tasks are included in the web console by default now, or are
added through simple plugins." Yes, in course design, we were looking for simple tasks where we
could highlight the web console in existing chapters, give the web console some attention, and
show students it is worth playing with.
• It is hard to teach priorities without using the term priorities. This section was rewritten because
the previous version was inarticulate and possibly misleading. Priorities are process scheduling
queues. Systems threads use them, but user threads don't any more. User threads are internal
priority ID 0, always. User threads are organized in a btree based on nice values and previous
CPU time balancing, which sounds like prioritizing but without priority queues. Much more
efficient, without the overhead of queue management.
• The most important concept in process scheduling: Thread scheduling only determines which
threads get process first, on an unsaturated system. All threads get all the time they want,
because the system is unsaturated.
• On a saturated system, the lowest value threads aren't going to get on CPU immediately and
have to wait. And that is where the value of the time-weighted binary tree comes in, in making
sure that no thread starves and that they all get a fair amount of scheduling.
RH134-RHEL9.0-en-2-20220609 11
12 RH134-RHEL9.0-en-2-20220609
Chapter 4
Chapter Schedule
ILT/VT Schedule
Introduction 3
Conclusion 2
RH134-RHEL9.0-en-2-20220609 13
Chapter 4 | Manage SELinux Security
Chapter Objectives
By the end of this chapter, students should be able to:
• Explain how SELinux protects resources, change the current SELinux mode of a system, and set
the default SELinux mode of a system.
• Manage the SELinux policy rules that determine the default context for files and directories with
the semanage fcontext command and apply the context defined by the SELinux policy to
files and directories with the restorecon command.
• Activate and deactivate SELinux policy rules with the setsebool command, manage the
persistent value of SELinux Booleans with the semanage boolean -l command, and consult
man pages that end with _selinux to find useful information about SELinux Booleans.
• Use SELinux log analysis tools and display useful information during SELinux troubleshooting
with the sealert command.
Key Takeaways
Key takeaways from this chapter include the following:
• Use the getenforce and setenforce commands to manage the SELinux mode of a system.
• The semanage command manages SELinux policy rules. The restorecon command applies
the context that the policy defines.
• Booleans are switches that change the behavior of the SELinux policy. You can enable or disable
them to tune the policy.
• The sealert command displays useful information to help with SELinux troubleshooting.
• The SELinux introduction is completely rewritten. All instructors are suggested to stare at the
decision-making flow diagram until every part of the architecture makes sense and can be easily
discussed.
14 RH134-RHEL9.0-en-2-20220609
Chapter 4 | Manage SELinux Security
• The newly announced feature that SELinux can only be fully disabled using a kernel parameter
does not change the ability to doable or use SELinux in permissive mode. What it does is take
away a major attack vector for getting around SELinux. Today, security is so important, and
an instructor can say with confidence that Linux is possibly the most secure operating system
available simply because of SELinux. As a "deny everything and allow only that with a written
policy", this is pretty solid.
• Previous SELinux discussion were light on explaining the context of using Booleans. It is not
just some odd switch. Every Boolean is a capability the service/app developer built into the
SELinux policy for that service/app, and the Boolean is the on/off switch for that capability.
If your students go read the *_selinux man pages for specific services, they will learn every
builtin Boolean capability supported. Sometimes the best thing about SELinux is learning those
Booleans; what scenario they are designed to facilitate and the realization that "hey, we could
use that in our organization."
• The section on investigating and resolving SELinux issues is explained better, but purposely
remains at an RHCSA level. Students are not expect to be expert SELinux troubleshooters, but
it would be valuable if the the take-away from this lecture is that AVC denials can be understood
and mitigated relatively easily.
RH134-RHEL9.0-en-2-20220609 15
16 RH134-RHEL9.0-en-2-20220609
Chapter 5
Chapter Schedule
ILT/VT Schedule
Introduction 3
A: Guided Exercise 20
Conclusion 2
RH134-RHEL9.0-en-2-20220609 17
Chapter 5 | Manage Basic Storage
Chapter Objectives
By the end of this chapter, students should be able to:
• Create storage partitions, format them with file systems, and mount them for use.
Key Takeaways
Key takeaways from this chapter include the following:
• The parted command adds, modifies, and removes partitions on disks with the MBR or the
GPT partitioning scheme.
• Curriculum overall is agnostic about partition editors, but specific developers have their
favorites. Know that we teach parted for a reason; primarily because everything in RHEL that
paritions uses the libparted library. This is about consistency across multiple tools when
teaching. Be careful not to dilute that message if you decide to teach other editors.
• parted informs the kernel when you create a partition. The kernel then triggers udev for the
creation of the device file under /dev/ (/dev/vdb1 for example). The udevadm settle
command blocks until udev has finished its work. Usually, this is a fast process, and students
should not notice a pause when running the udevadm settle command. This may, however,
be useful in scripts when you chain the creation of the partition and its formatting.
• When the system boots, systemd reads /etc/fstab and creates mount units from it, in /
run. You can list those units with systemctl -t mount --all. Systemd uses these units to
18 RH134-RHEL9.0-en-2-20220609
Chapter 5 | Manage Basic Storage
control and supervise your mounts. Every time you add or remove an entry from /etc/fstab,
it is a good practice to run systemctl daemon-reload to create or delete the corresponding
unit without having to reboot the system. Skipping this step should not prevent you from
mounting and using the file system. See the systemd.mount(5) man page for more details.
• Do not use mount -a to check /etc/fstab. The mount(8) man page states that it is a bad
practice. The only time you see the all option used in this course is after an /etc/fstab or
similar fix and reboot, where the actual intent is to check all mounts.
• Students may ask why they should create a partition on a LUN, and not directly use the LUN
block device. See the Knowledgebase: What are the advantages and disadvantages to using
partitioning on LUNs, either directly or with LVM in between? [https://access.redhat.com/
solutions/163853]
• Basic storage remains the same. Everything moves toward GPT and EFI, but we continue to
cover legacy structures because our customers till use them, for now.
• swapon -s is deprecated. Use swapon --show instead. See the swapon(8) man page.
• Swap is an enterprise server concept, but remains a common need. Servers always run with
swap configured. Servers shifted to the cloud and containers are a completely different handling
of memory needs and are not relevant for swap discussions.
RH134-RHEL9.0-en-2-20220609 19
20 RH134-RHEL9.0-en-2-20220609
Chapter 6
Chapter Schedule
ILT/VT Schedule
Introduction 3
A: Guided Exercise 20
Conclusion 2
RH134-RHEL9.0-en-2-20220609 21
Chapter 6 | Manage Storage Stack
Chapter Objectives
By the end of this chapter, students should be able to:
• Describe logical volume manager components and concepts, and implement LVM storage and
display LVM component information.
• Analyze the multiple storage components that make up the layers of the storage stack.
Key Takeaways
Key takeaways from this chapter include the following:
• You can use LVM to create flexible storage by allocating space on multiple storage devices.
• Physical volumes, volume groups, and logical volumes are managed by the pvcreate,
vgreduce, and lvextend commands.
• Logical volumes can be formatted with a file system or swap space, and they can be mounted
persistently.
• Additional storage can be added to volume groups and logical volumes can be extended
dynamically.
• Understand the layers and components of the storage stack to manage storage efficiently.
• Virtual Data Optimizer (VDO) uses LVM for compression and deduplication of data.
• You can use Stratis to perform an initial storage configuration or enable advanced storage
features.
• The VDO section is gone because VDO was simply incorporated into LVM. The python-based
command set is no longer needed. Creating a VDO volume is done by adding an option while
creating a logical volume. This is shown in this section.
22 RH134-RHEL9.0-en-2-20220609
Chapter 6 | Manage Storage Stack
• Show the students how to use the stratis command to manage Stratis pools and file systems.
• Stratis will be out of Tech Preview in an upcoming RHEL 9 minor release. Stratis makes more
sense when the student user has a visual of the layered stack that Stratis is managing. Stratis
handles these layers opaquely; handling partition management, device pools, dm, LVM
interactions, and XFS file systems.
*Curriculem debated whether to leave the stack and Stratis as two sections, or to teach Stratis
first before summarizing with the stack overview. But those choices did not support the purpose,
which is to grasp the basic elements of RHEL storage and use that knowledge as the Stratis
Storage tool tasks are taught. Therefore, the stack overview is intended to be presented as a
simple overview that feeds into the Stratis narrative.
• Some elements in the stack overview are taught elsewhere, such as Ceph ODS, multipath, and
RAID, and there is no need to do a deep dive or even go into much detail. The goal here is to
only introduce the terms and concepts.
• To repeat, the storage stack overview, before the Stratis content, is intended as a brief overview.
Do not do a deep dive on storage, and manage the questions effectively to communicate that
this is a terminology introduction to lead into the Stratis utility.
RH134-RHEL9.0-en-2-20220609 23
24 RH134-RHEL9.0-en-2-20220609
Chapter 7
Access Network-Attached
Storage
This chapter reviews accessing network-attached storage with the NFS
protocol.
Chapter Schedule
ILT/VT Schedule
Introduction 3
Conclusion 2
RH134-RHEL9.0-en-2-20220609 25
Chapter 7 | Access Network-Attached Storage
Chapter Objectives
By the end of this chapter, students should be able to:
• Identify NFS export information, create a directory to use as a mount point, mount an NFS
export with the mount command or by configuring the /etc/fstab file, and unmount an NFS
export with the umount command.
• Describe the benefits of using the automounter, and automount NFS exports by using direct
and indirect maps.
Key Takeaways
Key takeaways from this chapter include the following:
• Configure the automounter with direct and indirect maps, and describe their differences.
• Some NFS shares are need transiently and others are needed all the time. Understanding how
to connect using the mount command and the /etc/fstab file supports these use cases.
• Cover the basic features of NFSv4 as the default NFS version on RHEL8 and NFSv3 is the older
supported version, TCP as the protocol (which may mean firewalld needs to be opened), neither
UDP or RPCBIND are needed from RHEL 8, using a NFSv4-only solution, Server/Client.
• Demo manual mounts, show how to browse the server by mounting the root export and
how NFS shares are visible. We are using an NFSv4 share in the class, so you cannot demo
showmount command. Point out it is not reliable for NFSv4 and should only be used to query
NFSv3 servers.
• Show the students the new nfsconf tool, and the new /etc/nfs.conf configuration file.
26 RH134-RHEL9.0-en-2-20220609
Chapter 7 | Access Network-Attached Storage
• Show the students how to configure an NFSv4 only client with the nfsconf tool, and the /
etc/nfs.conf configuration file.
• The NFS storage section now explains the practical difference between NFSv3 and NFSv4,
which is the method by which you query a server looking for shares. It is important for students
to understand that concept of a single export tree, and how all shares can be seen in this one
tree. You will have some students who only thing of remote shares as existing as one per share,
as in older NFS and for SMB.
The export tree concept can be useful to demonstrate parsing. Explain to students that the real
shares in the export tree do not mount when you mount the export tree root. Also, a user who
can see the shares in the export tree might still not have the permissions required to mount those
shares.
• The auto-mounter does not require users to specifically mount and unmount shares (requiring
root or sudo privileges), or permanently mount the share via the /etc/fstab which may
consume system and network resources.
• The auto-mounter connects and disconnects on demand, and for all configured users on the
system.
• Make sure your students understand the benefits the auto-mounter brings to the table.
• Demo creating the master map file under /etc/auto.master.d/. Make sure the mandatory
extension of autofs is covered and that the file can be called anything. The mapping filename
is absolute.
• Demo creating the mapping files. Cover that the file name is not important but by convention
the file is located in /etc and is named auto.xxx with a meaningful extension. Discuss the
key values as absolute for direct and just the relative path for indirect. Highlight that the last
directory is managed by autofs and in the case of indirect is created and removed automatically
as needed. The options are the same as the mount command options, although mention -
fstype= option for other file systems. Finally the format of the share server: /path/to/
share.
• Direct maps use an absolute mount point, indirect maps use either a directory name or an * and
& to identify mount-points and locations.
• Demo the use of the * and & and make sure students understand what they do and how they
could use them to mount from a common parent directory to a common local parent, based on
the specified path. Mount options need to be shared as well as the parent directories!
• Narrative was added to introduce the automount systemd method, which can be useful. While
this method is much simpler and does not require all the configuration of the autofs server,
inform students that it can only be used for direct mounts, where the mount point is in a known
location and already exists.
RH134-RHEL9.0-en-2-20220609 27
28 RH134-RHEL9.0-en-2-20220609
Chapter 8
Chapter Schedule
ILT/VT Schedule
Introduction 3
A: Guided Exercise 20
A: Guided Exercise 20
Conclusion 2
RH134-RHEL9.0-en-2-20220609 29
Chapter 8 | Control the Boot Process
Chapter Objectives
By the end of this chapter, students should be able to:
• Describe the Red Hat Enterprise Linux boot process, set the default target when booting, and
boot a system to a non-default target.
• Log in to a system and change the root password when the current root password is lost.
• Manually repair file-system configuration or corruption issues that stop the boot process.
Key Takeaways
Key takeaways from this chapter include the following:
• The systemctl reboot and systemctl poweroff commands reboot and power down a
system, respectively.
• You can use the rd.break option on the kernel command line to interrupt the boot process
before control is handed over from the initramfs. The root file system is mounted read-only
under /sysroot.
• The emergency target can be used to diagnose and fix file-system issues.
• For more information on the boot process, refer to An introduction to the Linux boot and startup
processes at https://opensource.com/article/17/2/linux-boot-and-startup
• initramfs files are built from 2 cpio archives. The best way to inspect initramfs files is
through the lsinitrd command. For more information on the initramfs file format, refer
30 RH134-RHEL9.0-en-2-20220609
Chapter 8 | Control the Boot Process
• During the exercise, depending on the classroom environment and the physical keyboard layout,
some students may struggle to enter the root password, redhat, and to type commands in
emergency and rescue modes. Once logged in in the emergency or rescue shell, students can
use the loadkeys lang command to select a new layout temporarily. The available layout files
are in the /lib/kbd/keymaps/xkb/ directory. The following example set different layouts.
• In the boot loader, the line to update by appending rd.break may start by linux, linux16, or
linuxefi depending on the environment.
• There are a number of ways to break into a system when a user has physical access to the
machine. Each has a use case, benefits and drawbacks. This course teaches all of the relevant
methods: rd.break, emergency mode, and the rescue target.
• As an instructor, it is important to be teaching each for the purpose for which it was intended.
– Rescue mode breaks in with most initialization done and therefore is ready to use utilities to
fix the system with access to all disks.
– Emergency mode breaks in even early, after the root disk pivot, and can get an admin in
before hitting the issues in the boot process that are failing.
– The rd.break method drops in even earlier and gives access with almost nothing initialized, and
no SELinux loaded.
• This course teaches rd.break for setting the root password, because both rescue mode and
emrgency mode require an sulogin passowrd. Only rd.break accesses the system before
systemd takes over. Red Hat recommends rd.break for this task, and documents rd.break as the
method in the normal documention. You are welcome to teach whatever works, but remember
that teaching rd.break gives us the opportunity to explain the significance of the SELinux
autorelabel, and how files can end up with a file context if edited when SELinux modules are not
loaded.
• In this section, the students practice the emergency target method. This target is the most
appropriate for file system failures and other issues that happen during system initialization.
RH134-RHEL9.0-en-2-20220609 31
Chapter 8 | Control the Boot Process
• This section should be the only place where you see the use of mount -a, which is useful for
checking the complete /etc/fstab configuration. As mentioned previously, mount -a use is
discouraged, and should never be used as a lazy shortcut.
32 RH134-RHEL9.0-en-2-20220609
Chapter 9
Chapter Schedule
ILT/VT Schedule
Introduction 3
A: Guided Exercise 20
Conclusion 2
RH134-RHEL9.0-en-2-20220609 33
Chapter 9 | Manage Network Security
Chapter Objectives
By the end of this chapter, students should be able to:
• Verify that network ports have the correct SELinux type for services to bind to them.
Key Takeaways
Key takeaways from this chapter include the following:
• The netfilter framework allows kernel modules to inspect every packet traversing the
system, including all incoming, outgoing or forwarded network packets.
• The firewalld service simplifies management by classifying all network traffic into zones.
Each zone has its own list of ports and services. The public zone is set as the default zone.
• The firewalld service ships with a number of predefined services. You can list them by using
the firewall-cmd --get-services command.
• SELinux policy tightly controls network traffic by labeling the network ports. For example, port
22/TCP has the label ssh_port_t associated with it. When a process wants to listen on a port,
SELinux checks to see whether the label associated with it is allowed to bind that port label.
• Impress upon students that the predefined zones and predefined services are going to handle
the majority of their normal use cases, and that is sufficient to learn now. However, any time
they have a port requirement that is not covered by a predefined service, they will have to add
those as individual ports.
34 RH134-RHEL9.0-en-2-20220609
Chapter 9 | Manage Network Security
RH134-RHEL9.0-en-2-20220609 35
36 RH134-RHEL9.0-en-2-20220609
Chapter 10
Chapter Schedule
ILT/VT Schedule
Introduction 3
Conclusion 2
RH134-RHEL9.0-en-2-20220609 37
Chapter 10 | Install Red Hat Enterprise Linux
Chapter Objectives
By the end of this chapter, students should be able to:
• Explain Kickstart concepts and architecture, create a Kickstart file with the Kickstart
Generator website, modify an existing Kickstart file with a text editor and check its syntax with
ksvalidator, publish a Kickstart file to the installer, and install Kickstart on the network.
• Install a virtual machine on your Red Hat Enterprise Linux server with the web console.
Key Takeaways
Key takeaways from this chapter include the following:
• The RHEL 9 binary DVD includes Anaconda and all repositories required for installation.
• The RHEL 9 boot ISO includes the Anaconda installer, and can access repositories over the
network during installation.
• Kickstart files can be created by using the Kickstart Generator website or by copying and editing
/root/anaconda-ks.cfg.
• The Virtualization Host DNF package group provides the packages for a RHEL system to
become a virtualization host.
• The manual installation of Red Hat Enterprise Linux& 9 is similar to previous versions of RHEL.
• To burn a binary DVD, you need a dual layer DVD because of the size of the ISO file.
38 RH134-RHEL9.0-en-2-20220609
Chapter 10 | Install Red Hat Enterprise Linux
• There is only a single build of RHEL 9 per processor architecture. The variants such as Server,
Workstation, or Desktop do not require a specific ISO anymore.
• The System Purpose item allows administrators to define what the system will be used for and
what support level it should receive. Anaconda gives this information to Subscription Manager
which can more accurately choose the appropriate subscription for the system.
• The kickstart parameters and method haven't changed, at the level we teach here at the RHCSA
level. Still, you can tell the students that each new RHEL release adds functionality and makes
kickstart easier to use for custom builds with tools that use kickstart files.
• Web Console supports the most often used configuration options. When you need advanced
features or customization, use the virsh command.
RH134-RHEL9.0-en-2-20220609 39
40 RH134-RHEL9.0-en-2-20220609
Chapter 11
Run Containers
This chapter reviews obtaining, running, and managign simple lightweight
services as containers on a single Red Hat Enterprise Linux server.
Chapter Schedule
ILT/VT Schedule
Introduction 3
A: Quiz 5
A: Guided Exercise 25
Conclusion 2
RH134-RHEL9.0-en-2-20220609 41
Chapter 11 | Run Containers
Chapter Objectives
By the end of this chapter, students should be able to:
• Explain container concepts and the core technologies for building, storing, and running
containers.
• Discuss container management tools for using registries to store and retrieve images, and for
deploying, querying, and accessing containers.
• Provide persistent storage for container data by sharing storage from the container host, and
configure a container network.
• Configure a container as a systemd service, and configure a container service to start at boot
time.
Key Takeaways
Key takeaways from this chapter include the following:
• Containers provide a lightweight way to distribute and run an application with its dependencies
so that it does not conflict with installed software on the host.
• Containers run from container images that you can download from a container registry or create
yourself.
• You can use container files with instructions to build a customized container image.
• Podman, which Red Hat Enterprise Linux provides, directly runs and manages containers and
container images on a single host.
• Containers can be run as root, or as non-privileged rootless containers for increased security.
• You can map network ports on the container host to pass traffic to services that run in its
containers.
• You can use environment variables to configure the software in containers at build time.
• Container storage is temporary, but you can attach persistent storage to a container by using
the contents of a directory on the container host, for example.
• You can configure a systemd unit file to automatically run containers when the system starts.
42 RH134-RHEL9.0-en-2-20220609
Chapter 11 | Run Containers
Container Concepts
• Useful reference for instructors on running containers: Section 1.3. Running containers without
Docker at https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-
single/building_running_and_managing_containers/index
Deploy Containers
• If a student makes a mistake when running a container and wishes to start over, then the student
first needs to delete the wrong container. To do so, the student can run the two following
commands to delete all the containers on their system:
Inside the container, the process has the user ID 27. From the host point of view, the process has
the user ID 100026. With that example, when preparing a host directory for the database, you
must make sure that the user ID 100026 has read/write access to it.
• For simplicity, when using shared storage in exercises, instructions ask students to set the
directory mode to 777 or ensure that the mode allows access. A more realistic way would be
to set the directory ownership to the user ID running the container processes (100026 in the
preceding example). However, that would require to compute that user ID, and then to run the
chown command as root. Dealing with user namespaces and SELinux on rootless containers
RH134-RHEL9.0-en-2-20220609 43
Chapter 11 | Run Containers
[https://www.redhat.com/sysadmin/user-namespaces-selinux-rootless-containers] provides an
easier way to set the ownership with the podman unshare command.
• To use systemctl --user commands, users must log in at the console or directly through
SSH. If students use su or sudo to switch to the student account, instead of using SSH, the
typical error message when using systemctl --user is as follows:
44 RH134-RHEL9.0-en-2-20220609
Chapter 12
Comprehensive Review
This chapter reviews tasks from Red Hat System Administration II.
Chapter Schedule
ILT/VT Schedule
Introduction 3
Conclusion 2
RH134-RHEL9.0-en-2-20220609 45
Chapter 12 | Comprehensive Review
Chapter Objectives
By the end of this chapter, students should be able to:
Key Takeaways
Key takeaways from this chapter include the following:
• Comprehensive Reviews are now given only a specifications, and not as instructions. This makes
them different than end of chapter labs. Remind students that the solution we provide is one
way to do it, and they might use different tools to achieve the same thing. In reality, there is
usually only one way to accomplish system administration configurations, and that admonition is
better applied in developer-style course.
46 RH134-RHEL9.0-en-2-20220609
Chapter 12 | Comprehensive Review
Run Containers
• This lab is similar to the exercises done earlier but the topic is broad enough that this is useful
practice to gain familiarity needed to pass the exam.
RH134-RHEL9.0-en-2-20220609 47
48 RH134-RHEL9.0-en-2-20220609