Red Hat System Administration I

RH124

Welcome

Course Objectives and Structure

Schedule

Chapter 1: Get Started with Red Hat Enterprise Linux

Goal: Define open source, Linux, Linux distributions, and Red Hat Enterprise Linux.


Objectives:

  • Explain the purpose of open source, Linux, Linux distributions, and Red Hat Enterprise Linux.

What Is Linux?

Why Should You Learn about Linux?

What Makes Linux Great?

What Is Open Source Software?

What Is a Linux Distribution?

Who Is Red Hat?

Red Hat Enterprise Linux Ecosystem

The Red Hat Enterprise Linux ecosystem

Red Hat Enterprise Linux continuous development

Obtaining Red Hat Enterprise Linux

Quiz: Get Started with Red Hat Enterprise Linux

Summary

  • Open source software has source code that anyone can freely use, study, modify, and share.
  • A Linux distribution is an installable operating system that is constructed from a Linux kernel and that supports user programs and libraries.
  • Red Hat participates in supporting and contributing code to open source projects; sponsors and integrates project software into community-driven distributions; and stabilizes the software to offer it as supported enterprise-ready products.

Summary (continued)

  • Red Hat Enterprise Linux is the open source, enterprise-ready, commercially supported Linux distribution that Red Hat provides.
  • A free Red Hat Developer Subscription is a useful method for obtaining learning resources and information, including developer subscriptions to Red Hat Enterprise Linux and other Red Hat products.

Chapter 2: Access the Command Line

Goal: Log in to a Linux system and run simple commands from the shell.


Objectives:

  • Log in to a Linux system and run simple commands from the shell.

  • Log in to the Linux system with the GNOME desktop environment to run commands from a shell prompt in a terminal program.

  • Save time when running commands from a shell prompt with Bash shortcuts.

Access the Command Line

Introduction to the Bash Shell

Log in to a Local System

Log in to a Remote System

Log Out from a Remote System

Quiz: Access the Command Line

Access the Command Line with the Desktop

Introduction to the GNOME Desktop Environment

The RHEL 9 login screen

Closeup of an open message tray

Guided Exercise: Access the Command Line with the Desktop

Execute Commands with the Bash Shell

Basic Command Syntax

Quiz: Execute Commands with the Bash Shell

Lab: Access the Command Line

Summary

  • The Bash shell is a command interpreter that prompts interactive users to specify Linux commands.
  • Many commands have a --help option that displays a usage message or screen.
  • You can use workspaces to organize multiple application windows.
  • The Activities button at the upper-left corner of the top bar provides an overview mode that helps to organize windows and to start applications.
  • The file command scans the beginning of a file and displays what type it is.
  • The head and tail commands display the beginning and end of a file, respectively.

Summary (continued)

  • You can use tab completion to complete file names when typing them as arguments to commands.
  • You can use the graphical interface for many administrative tasks. You can disable the interface to preserve resources for running applications.
  • You can write many commands in the same line by using the semicolon ; character, and can run a single command in multiple lines by using the backslash \ character.

Chapter 3: Manage Files from the Command Line

Goal: Copy, move, create, delete, and organize files from the Bash shell.


Objectives:

  • Describe how Linux organizes files, and the purposes of various directories in the file-system hierarchy.

  • Specify the absolute location and relative location of files to the current working directory, determine and change the working directory, and list the contents of directories.

  • Create, copy, move, and remove files and directories.

  • Create multiple file name references to the same file with hard links and symbolic (or "soft") links.

  • Efficiently run commands that affect many files by using pattern matching features of the Bash shell.

Describe Linux File System Hierarchy Concepts

The File-system Hierarchy

Significant file-system directories in Red Hat Enterprise Linux 9

Quiz: Describe Linux File System Hierarchy Concepts

Specify Files by Name

Absolute Paths and Relative Paths

Navigate Paths in the File System

Quiz: Specify Files by Name

Manage Files with Command-line Tools

Command-line File Management

Guided Exercise: Manage Files with Command-line Tools

Make Links Between Files

Manage Links Between Files

Guided Exercise: Make Links Between Files

Match File Names with Shell Expansions

Command-line Expansions

Protecting Arguments from Expansion

Quiz: Match File Names with Shell Expansions

Lab: Manage Files from the Command Line

Summary

  • Files on a Linux system are organized into a single inverted tree of directories, a file-system hierarchy.
  • Absolute paths start with a forward slash character (/) and specify the location of a file in the file-system hierarchy.
  • Relative paths do not start with a forward slash character.
  • Relative paths specify a file location in relation to the current working directory.
  • You can use commands in combination with the dot (.), double dot (..), and tilde (~) special characters to refer to a file location in the file system.

Summary (continued)

  • The mkdir, rmdir, cp, mv, and rm commands are key commands to manage files in Linux.
  • Hard links and soft links are different ways for multiple file names to point to the same data.
  • The Bash shell provides pattern matching, expansion, and substitution features to help you to run commands efficiently.

Chapter 4: Get Help in Red Hat Enterprise Linux

Goal: Resolve problems by using local help systems.


Objectives:

  • Find information in local Linux system manual pages.

Read Manual Pages

Introduction to the Linux Manual Pages

Navigate and Search man Pages

Search for man Pages by Keyword

Guided Exercise: Read Manual Pages

Lab: Get Help in Red Hat Enterprise Linux

Summary

  • Use the man command to view man pages and to display information about components of a Linux system, such as files, commands, and functions.
  • By convention, to refer to a man page, the name of a page is followed by its section number in parentheses.
  • You can use regular expressions to search content in man pages.

Chapter 5: Create, View, and Edit Text Files

Goal: Create, view, and edit text files from command output or in a text editor.


Objectives:

  • Save output or errors to a file with shell redirection, and process command output through multiple command-line programs with pipes.

  • Create and edit text files from the command line with the vim editor.

  • Set shell variables to run commands, and edit Bash startup scripts to set shell and environment variables to modify the behavior of the shell and programs that are run from the shell.

Redirect Output to a File or Program

Standard Input, Standard Output, and Standard Error

Process I/O channels (file descriptors)

Redirect Output to a File

Construct Pipelines

Process I/O piping

Process I/O piping with tee

Quiz: Redirect Output to a File or Program

Edit Text Files from the Shell Prompt

Edit Files with Vim

Moving between Vim modes

Guided Exercise: Edit Text Files from the Shell Prompt

Change the Shell Environment

Shell Variable Usage

Configure Programs with Environment Variables

Set Variables Automatically

Unset and Unexport Variables and Aliases

Guided Exercise: Change the Shell Environment

Lab: Create, View, and Edit Text Files

Summary

  • Running programs, or processes, have three standard communication channels: standard input, standard output, and standard error.
  • You can use I/O redirection to read standard input from a file or to write the output or errors from a process to a file.
  • Pipelines can connect standard output from one process to the standard input of another process, and can format output or build complex commands.

Summary (continued)

  • Know how to use at least one command-line text editor, and Vim is the recommended option because it is commonly installed by default in Linux distributions.
  • Shell variables can help you to run commands, and are unique to a shell session.
  • You can modify the behavior of the shell or the processes with environment variables.

Chapter 6: Manage Local Users and Groups

Goal: Create, manage, and delete local users and groups, and administer local password policies.


Objectives:

  • Describe the purpose of users and groups on a Linux system.

  • Switch to the superuser account to manage a Linux system, and grant other users superuser access through the sudo command.

  • Create, manage, and delete local user accounts.

  • Create, modify, and delete local group accounts.

  • Set a password management policy for users, and manually lock and unlock user accounts.

Describe User and Group Concepts

What Is a User?

What Is a Group?

Quiz: Describe User and Group Concepts

Gain Superuser Access

The Superuser

Switch User Accounts

Run Commands with Sudo

Guided Exercise: Gain Superuser Access

Manage Local User Accounts

Manage Local Users

Guided Exercise: Manage Local User Accounts

Manage Local Group Accounts

Manage Local Groups

Guided Exercise: Manage Local Group Accounts

Manage User Passwords

Shadow Passwords and Password Policy

Configure Password Aging

Password aging parameters

Restrict Access

Guided Exercise: Manage User Passwords

Lab: Manage Local Users and Groups

Summary

  • The user account types in Linux are the superuser, system users, and regular users.
  • A user has a primary group and might be a member of supplementary groups.
  • The /etc/passwd, /etc/group, and /etc/shadow critical files contain user and group information.
  • You can run commands as the superuser with the su and sudo commands.
  • The useradd, usermod, and userdel commands manage users.
  • The groupadd, groupmod, and groupdel commands manage groups.
  • The passwd command manages passwords for users.
  • The chage command displays and configures password expiration settings for users.

Chapter 7: Control Access to Files

Goal: Set Linux file-system permissions on files and interpret the security effects of different permission settings.


Objectives:

  • List file-system permissions on files and directories, and interpret the effects of those permissions on access by users and groups.

  • Change the permissions and ownership of files with command-line tools.

  • Control the default permissions of user-created files, explain the effects of special permissions, and use special and default permissions to set the group owner of files that are created in a directory.

Interpret Linux File System Permissions

Linux File-system Permissions

View File and Directory Permissions and Ownership

Examples of Permission Effects

Quiz: Interpret Linux File System Permissions

Manage File System Permissions from the Command Line

Change File and Directory Permissions

Visual representation of the octal method

Change File and Directory User or Group Ownership

Guided Exercise: Manage File System Permissions from the Command Line

Manage Default Permissions and File Access

Special Permissions

Default File Permissions

Example of umask calculation on a file

Example of umask calculation on a directory

Guided Exercise: Manage Default Permissions and File Access

Lab: Control Access to Files

Summary

  • File ownership permissions have three categories. A file is owned by a user, a single group, and other users. The most specific permission applies. User permissions override group permissions, and group permissions override other permissions.
  • The ls command -l option expands the file listing to include both the file permissions and ownership.
  • The chmod command changes file permissions from the command line.
  • The chmod command can use one of two methods to represent permissions: symbolic or octal.
  • The chown command changes file ownership. The chown command -R option recursively changes the ownership of a directory tree.

Summary (continued)

  • The umask command without arguments displays the current umask value of the shell. Every process on the system has a umask.
  • The default umask values for Bash are defined in the /etc/login.defs file and might be affected by settings in the /etc/profile and /etc/bashrc files, files in /etc/profile.d, or your account's shell initialization files.
  • The suid, sgid, and sticky special permissions provide additional access-related features to files.

Chapter 8: Monitor and Manage Linux Processes

Goal: Evaluate and control processes that run on a Red Hat Enterprise Linux system.


Objectives:

  • Determine status, resource use, and ownership of running programs on a system, to control them.

  • Use Bash job control to manage multiple processes that were started from the same terminal session.

  • Use commands to kill and communicate with processes, define the characteristics of a daemon process, and stop user sessions and processes.

  • Define load average and determine resource-intensive server processes.

Process States and Lifecycle

Definition of a Process

Process lifecycle

Describe Process States

Linux process states

Listing Processes

Quiz: Process States and Lifecycle

Control Jobs

Describe Jobs and Sessions

Run Jobs in the Background

Guided Exercise: Control Jobs

Kill Processes

Process Control with Signals

Terminate Background Jobs

Administratively Log Out Users

Guided Exercise: Kill Processes

Monitor Process Activity

Describe Load Average

Real-time Process Monitoring

Guided Exercise: Monitor Process Activity

Lab: Monitor and Manage Linux Processes

Summary

  • A process is a running instance of an executable program. Processes are assigned a state, which can be running, sleeping, stopped, or zombie. The ps command lists processes.
  • Each terminal has its own session, and can have a foreground process and independent background processes. The jobs command displays processes within a terminal session.
  • A signal is a software interrupt that reports events to an executing program. The kill, pkill, and killall commands use signals to control processes.
  • Load average is an estimate of how busy the system is. To display load average values, you can use the top, uptime, or w commands.

Chapter 9: Control Services and Daemons

Goal: Control and monitor network services and system daemons with the systemd service.


Objectives:

  • List system daemons and network services that the systemd service and socket units started.

  • Control system daemons and network services with the systemctl command.

Identify Automatically Started System Processes

Introduction to the systemd Daemon

Service Units Description

List Service Units

View Service States

Verify the Status of a Service

Guided Exercise: Identify Automatically Started System Processes

Control System Services

Start and Stop Services

Restart and Reload Services

List Unit Dependencies

Mask and Unmask Services

Enable Services to Start or Stop at Boot

Summary of systemctl Commands

Guided Exercise: Control System Services

Lab: Control Services and Daemons

Summary

  • The systemd utility provides a method for activating system resources, server daemons, and other processes, both at boot time and on a running system.
  • Use the systemctl utility to start, stop, reload, enable, and disable services.
  • Use the systemd utility to manage service units, socket units, and path units.
  • Use the systemctl status command to determine the status of system daemons and network services that the systemd utility started.
  • The systemctl list-dependencies command lists all service units that a specific service unit depends on.
  • The systemd utility can mask a service unit so that it does not run, even to satisfy dependencies.

Chapter 10: Configure and Secure SSH

Goal: Configure secure command-line service on remote systems with OpenSSH.


Objectives:

  • Log in to a remote system and run commands with ssh.

  • Configure a user account to use key-based authentication to log in to remote systems securely without a password.

  • Disable direct logins as root and password-based authentication for the OpenSSH service.

Access the Remote Command Line with SSH

Describe Secure Shell

Secure Shell Examples

Identifying Remote Users

SSH Host Keys

Guided Exercise: Access the Remote Command Line

Configure SSH Key-based Authentication

SSH Key-based Authentication

Guided Exercise: Configure SSH Key-based Authentication

Customize OpenSSH Service Configuration

Configure the OpenSSH Server

Guided Exercise: Customize OpenSSH Service Configuration

Lab: Configure and Secure SSH

Summary

  • With the ssh command, users can access remote systems securely with the SSH protocol.
  • A client system stores the identities of remote servers in the ~/.ssh/known_hosts and /etc/ssh/ssh_known_hosts files.
  • SSH supports both password-based and key-based authentication.
  • The ssh-keygen command generates an SSH key pair for authentication. The ssh-copy-id command exports the public key to remote systems.
  • The sshd service implements the SSH protocol on Red Hat Enterprise Linux systems.

Summary (continued)

  • Configure advanced SSH settings in the /etc/ssh/sshd_config configuration file.
  • It is a recommended practice to configure sshd to disable remote logins as root and to require public key authentication rather than password-based authentication.

Chapter 11: Manage Networking

Goal: Configure network interfaces and settings on Red Hat Enterprise Linux servers.


Objectives:

  • Describe fundamental concepts of network addressing and routing for a server.

  • Test and inspect the current network configuration with command-line utilities.

  • Manage network settings and devices with the nmcli command.

  • Modify network configuration by editing configuration files.

  • Configure a server's static hostname and its name resolution and test the results.

Describe Networking Concepts

TCP/IP Network Model

Comparison of the TCP/IP and OSI network models

Describe Network Interface Names

IPv4 Networks

IPv4 netmask calculation for a small network

IPv4 netmask calculation for a larger network

Example network topology

IPv6 Networks

IPv6 address parts and subnetting

Hostnames and IP Addresses

Quiz: Describe Networking Concepts

Validate Network Configuration

Gather Network Interface Information

Verify Connectivity Between Hosts

Troubleshoot Router Issues

Troubleshoot Port and Service Issues

Guided Exercise: Validate Network Configuration

Configure Networking from the Command Line

Describe the NetworkManager Service

Manage Network Connections

Guided Exercise: Configure Networking from the Command Line

Edit Network Configuration Files

Connection Configuration Files

Guided Exercise: Edit Network Configuration Files

Configure Hostnames and Name Resolution

Update the System Hostname

Configure Name Resolution

Guided Exercise: Configure Hostnames and Name Resolution

Lab: Manage Networking

Summary

  • The TCP/IP network model is a simplified, four-layered set of abstractions that describes how different protocols interoperate for computers to send traffic from one machine to another over the internet.
  • IPv4 is the primary network protocol on the internet today.
  • IPv6 is intended as an eventual replacement for the IPv4 network protocol.
  • By default, Red Hat Enterprise Linux operates in dual-stack mode, and uses both network protocols in parallel.
  • Network routes determine the correct network interface to send packets to a particular network.
  • The NetworkManager daemon monitors and manages network configuration.

Summary (continued)

  • The nmcli command-line tool configures network settings with the NetworkManager daemon.
  • Starting in Red Hat Enterprise Linux 9, the default location for network configurations is the /etc/NetworkManager/system-connections directory.
  • The system's static hostname is stored in the /etc/hostname file.
  • The hostnamectl command modifies or views the status of the system's hostname and related settings.

Chapter 12: Install and Update Software Packages

Goal: Download, install, update, and manage software packages from Red Hat and DNF package repositories.


Objectives:

  • Register a system by using your Red Hat account and assign it entitlements for software updates and support services provided by Red Hat.

  • Explain how software is provided as RPM packages, and investigate the DNF and RPM installed system packages.

  • Find, install, and update software packages with the dnf command.

  • Enable and disable server use of Red Hat or third-party DNF repositories.

Register Systems for Red Hat Support

Red Hat Subscription Management

Subscribe a System to Red Hat

The Register System dialog box

Web console subscriptions

Entitlement Certificates

Quiz: Register Systems for Red Hat Support

Explain and Investigate RPM Software Packages

Software Packages and RPM

RPM file name elements

Examine RPM Packages

Install RPM Packages

Guided Exercise: Explain and Investigate RPM Software Packages

Install and Update Software Packages with DNF

Manage Software Packages with DNF

Manage Package Module Streams with DNF

Guided Exercise: Install and Update Software Packages with DNF

Enable DNF Software Repositories

Enable Red Hat Software Repositories

Guided Exercise: Enable DNF Software Repositories

Lab: Install and Update Software Packages

Summary

  • RHEL provides tools to entitle machines to product subscriptions, get updates to software packages, and track information about support contracts and subscriptions that the systems use.
  • Software is provided as RPM packages, to install, upgrade, and uninstall software on the system.
  • The rpm command can query a local database to provide information about the contents of installed packages and to install downloaded package files.

Summary (continued)

  • The dnf utility is a powerful command-line tool to install, update, remove, and query software packages.
  • Red Hat Enterprise Linux uses Application Streams to provide a single repository to host multiple versions of an application's packages and its dependencies.

Chapter 13: Access Linux File Systems

Goal: Access, inspect, and use existing file systems on storage that is attached to a Linux server.


Objectives:

  • Identify a directory in the file-system hierarchy and the device where it is stored.

  • Access the contents of file systems by adding and removing file systems in the file-system hierarchy.

  • Search for files on mounted file systems with the find and locate commands.

Identify File Systems and Devices

Storage Management Concepts

Examine File Systems

Quiz: Identify File Systems and Devices

Mount and Unmount File Systems

Mount File Systems Manually

Unmount File Systems

Guided Exercise: Mount and Unmount File Systems

Locate Files on the System

Search for Files

Locate Files by Name

Search for Files in Real Time

Guided Exercise: Locate Files on the System

Lab: Access Linux File Systems

Summary

  • Storage devices are represented by the block device file type.
  • The df command reports total disk space, used disk space, and free disk space on all mounted regular file systems.
  • The root user can use the mount command to manually mount a file system.
  • To successfully unmount a device, all processes must stop accessing the mount point.
  • The removable storage devices are mounted in the /run/media directory when using the graphical environment.
  • The lsblk command lists the details of block devices, such as the size and the UUID.
  • The find command searches in real time in the local file systems for files according to search criteria.

Chapter 14: Analyze Servers and Get Support

Goal: Investigate and resolve issues in the web-based management interface, getting support from Red Hat to help solve problems.


Objectives:

  • Activate the web console management interface to remotely manage and monitor the performance of a Red Hat Enterprise Linux server.

  • Describe and use the Red Hat Customer Portal key resources to find information from Red Hat documentation and the Knowledgebase.

  • Use Red Hat Insights to analyze servers for issues, remediate or resolve them, and confirm that the solution worked.

Analyze and Manage Remote Servers

Describe the Web Console

Enable the Web Console

Log in to the Web Console

The web console login screen

Non-privileged user's title bar

Privileged user's title bar

Change Passwords in the Web Console

User accounts

User account details

Setting and resetting passwords

Troubleshoot with the Web Console

Non-privileged user's Overview page

Non-privileged user's system performance metrics

Log severity selections

Log entry selection

Log entry details

Non-privileged terminal session troubleshooting

Create a diagnostic report

Download a completed report

Manage System Services with the Web Console

System power options

Services: Initial view

Services: Service details and management interface

Networking: Initial view

Networking: Interface details

Add an IP address to an existing interface

Confirm the new IP address

Existing user accounts

Create an account

Account management page

Guided Exercise: Analyze and Manage Remote Servers

Create a Diagnostics Report

Resources on the Red Hat Customer Portal

Tour of the Red Hat Customer Portal

Red Hat Customer Portal Menus

Contact Red Hat Customer Support

Join the Red Hat Developer Program

Guided Exercise: Create a Diagnostics Report

Detect and Resolve Issues with Red Hat Insights

Introduction to Red Hat Insights

Insights high-level architecture

Insights inventory on the Cloud Portal

Red Hat Insights Console Navigation

Recommendations from the Advisor Service

Details of an issue

Report from the Vulnerability service

Details of a CVE

Patching a system

Comparing system history

Details of a custom rule

Quiz: Detect and Resolve Issues with Red Hat Insights

Summary

  • The web console is a web-based management interface to your server, and is based on the open source cockpit service.
  • The web console provides graphs of system performance, graphical tools to manage system configuration and to inspect logs, and interactive terminal interfaces.
  • The Red Hat Customer Portal provides access to documentation, downloads, optimization tools, support case management, and subscription and entitlement management for your Red Hat products.

Summary (continued)

  • The redhat-support-tool command-line tool queries Knowledgebase and works with support cases.
  • Red Hat Insights is a SaaS-based predictive analytics tool to help you to identify and remediate threats to your systems' security, performance, availability, and stability.

Chapter 15: Comprehensive Review

Comprehensive Review

Reviewing Red Hat System Administration I

Lab: Manage Files from the Command Line

Lab: Manage Users and Groups, Permissions, and Processes

Lab: Configure and Manage a Server

Lab: Manage Networks

Lab: Mount File Systems and Find Files

RH124-RHEL9.3-en-1-20240717