The Enterprise Linux Administrator: Journey to a New Linux Career

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Learn the basics, followed by the more advanced skills you will need to become an Enterprise Linux administrator. This book will prepare you to use Linux effectively with a clearer understanding of what is needed to successfully leverage new opportunities.

After building a solid Linux knowledge foundation, you will learn how three major community Linux distributions are installed, configured, and used. The book will then guide you through all the different configurations a Linux administrator should know, along with some useful exercises for you to practice. 
Moving on, you will look at Enterprise Linux distributions, and how they are installed and configured. This will be the step that will elevate you from being a Linux administrator to an enterprise Linux administrator. You will also learn how an enterprise Linux administrator configures Linux security, high availability, automation, and large-scale Linux deployments. These skills are required when working in larger Linux estates. Finally, you'll review backups, recovery, and some general troubleshooting.
By the end of this book, you'll not only learn how to become an Enterprise Linux administrator but will also learn what certifications are vital when competing for new career opportunities.

What You'll Learn

  • Install your own Linux environment
  • Study the basics to configuring Linux
  • Become an Enterprise Linux administrator and how to get there
  • Review comprehensive examples on how to use Linux

Who This Book Is For

Those in the IT industry who have no Linux training or experience who wish to learn how to manage a Linux system

Author(s): Kenneth Hitchcock
Edition: 1
Publisher: Apress
Year: 2023

Language: English
Pages: 625
City: Berkeley
Tags: GNU/Linux; Network Configuration; Disk Configuration; Service Management; Security; Scripting and Automation; Enterprise Linux; Fedora; Ubuntu; RHEL; OpenSuse; Suse; Troubleshooting

Table of Contents
About the Author
About the Technical Reviewer
Acknowledgments
Introduction
Part I: Requirements and Linux Background
Chapter 1: Requirements
Information Technology Basics
Hardware
Required Knowledge
Software
Required Knowledge
Networking
Required Knowledge
Further Reading
Hardware
POST
Boot Process
Computer Memory
System Buses
Software
The Operating System
Kernel
Device Driver
Network
Computer Networking
The OSI Model
Storage
Further Study
Free Online Courses
Paid-For Online Courses
Hardware and Software
Basic Hardware Courses
Networking
Summary
Chapter 2: Origins and Brief History
Unix and Linux History
Unix
Multics
Early Unix
Unix 2, Love Ken
First Commercially Available Unix
Unix Limitation
Unix Variations
Unix Standards
Unix Growth in the 1990s
Linux History
Linus Torvalds
Kernel
Very Early Linux
The Kernel Is Not Enough
Free Software Foundation
OpenSource
Enterprise Linux
Evolution of Linux
Debian
Important Milestones of Linux
Kernel 2.0
Linux Desktop
Desktop Wars
Dell, Oracle, and Red Hat Started to Grow
Kernel 3.0
Systemd
Android and Ubuntu Increased in Popularity
Kernel 4.0
Kernel 5.0
Linux Now and in the Future
Summary
Chapter 3: Linux Explained
Linux Operating System
Kernel
Monolithic and Modular
Kernel Architecture
Functionality Pillars
Layers
Kernel Map
System Calls
Process Control
File Management
Device Management
Information Management
Communication
Protection
Initial Ramdisk
Missing Drivers
Everything Is a File, Mostly
Utilities
Shell
Other Utilities
Desktops
Common Distributions
Differences
Package Management
Upstream Projects
Unique Distributions
Operating System Differences
Windows
Not OpenSource
Windows vs. Linux
Uses of Linux
Servers
Desktop
Mobile Devices
IoT
Future Linux
Summary
Part II: Getting Started
Chapter 4: Installing Linux for the First Time
Where to Get Linux
OpenSource and Free Software
Enterprise Linux
Red Hat
Red Hat Enterprise Linux
Canonical
Ubuntu
SUSE
SLES Server and Desktop
Community
Fedora
OpenSUSE
Ubuntu
Virtualization
What Is Virtualization?
Types of Virtualization
Hardware Requirement
BIOS Requirements
Windows Virtualization
VirtualBox
Exercise
Linux Virtualization
KVM
Exercise
Creating Virtual Machines
VirtualBox
Exercise
KVM
Exercise
Installation Media
Burn Image
USB Drive
MediaWriter
Ventoy
Learning Exercise
Network Install
Installing Linux
Lab Environment
Hypervisor
Installation Media
Virtual Machine Sizing
Ubuntu
Installation Media
Basic Installation
Create a Virtual Machine
Ubuntu Server Installation
Basic Exercise
Virtual Machine
Ubuntu Server
Exercise Outcome
Custom Installations
Optional Custom Exercise
Virtual Machine
Ubuntu Server
Fedora Server
Installation Media
Basic Installation
Create a Virtual Machine
Fedora Server Installation
Basic Exercise
Virtual Machine
Fedora Server
Exercise Outcome
Custom Installations
Optional Custom Exercise
Fedora Server
OpenSUSE
Installation Media
Basic Installation
Create a Virtual Machine
OpenSUSE Server Installation
Basic Exercise
Virtual Machine
OpenSUSE Server
Exercise Outcome
Custom Installations
Optional Custom Exercise
OpenSUSE Server
Upgrading Linux
Upgrade vs. Migration
Before Upgrading
Backup
Check Disk Space
Confirm Your Version Can Be Upgraded
What Distributions Can Be Upgraded
Ubuntu
Fedora
OpenSUSE
Exercise
Upgrade Ubuntu
Upgrade Fedora
Upgrade OpenSUSE
Summary
Chapter 5: Using Linux for the  First Time
Accessing Linux
Console
Virtualization
Hardware Consoles
Why Is the Console Important?
SSH
Logging into Another Linux System
Putty
WinSCP
SSH Configuration Files
sshd_config
SSH Keys
Web Console
Installing Cockpit
Accessing Cockpit
Exercise
Enable Passwordless ssh
Configure Cockpit
Command Line
Finding Help
Man Pages
Navigating the Filesystem
Listing Files
Changing Directories
Don't Know Where Are You?
Summary of the Very Basics
Finding Files
Editing Files
Desktop Utilities
Command-Line Editing
Using vi and vim
Command Mode
Edit Mode
Example
Command-Line Shortcuts
Alias
Scripts
Different Commands in Different Distributions
Fedora – dnf
Ubuntu – apt
OpenSUSE – zypper
Exercise
Finding Files
Old Files
Files with Permissions
Creating File with Content
Installing a Package
Desktop Basics
Installing Different Desktops
Fedora Server
Ubuntu Server
OpenSUSE Server
Enabling and Disabling Desktops
Enable Graphical Desktop
Disable Graphical Desktop
Why Not Install Desktop During Installation
Exercise
Remove Cinnamon
Install the MATE Desktop
Optional – Try Another Desktop
Summary
Untitled
Part III: Basic Configuration
Chapter 6: Access Control
SSH and SSHD Configuration
Configuration Files
ssh_config
sshd_config
ssh_config.d and sshd_config.d
Important ssh Parameters
PermitRootLogin
PasswordAuthentication
Port
ListenAddress
MaxAuthTries
UsePam
AllowUsers and DenyUsers
AllowGroups and DenyGroups
LogLevel
Default Configuration
Fedora
Ubuntu
OpenSUSE
SSH Service
Test Syntax
Restart sshd
Check Status
Debugging ssh Issues
Service Dead
Syntax Error
Firewall Rule
Network and Port
Incorrect Allow or Deny
Exercise
Change Port
Create custom_sshd.conf
Users and Groups
Local Users and Groups
Configuration Files
Creating Users
Setting a Password
Modifying a User
Removing Users
User Password Management
Creating Groups
Modifying a Group
Removing Groups
Remote Users and Groups
Windows Active Directory
FreeIPA
Using Remote Users and Groups
Windows Active Directory
IPA-Client
Sudo
Sudo Commands and Tools
Managing Sudo
Exercise
Create a New User
Create a New Group
Elevate Permissions
File and Directory Permissions
Understanding Linux Permissions
Directory Listing Explained
Managing File and Directory Permissions
Chmod
Example
Chown
Example
ACLs
getfacl
setfacl
Example
Exercise
File and Directory Permissions
ACLs
Summary
Chapter 7: Package Installation
Installing Packages
Package Management Systems
Fedora
Command Line
dnf
Using dnf
Getting More out of dnf
Desktop
Ubuntu
Command Line
apt
Using apt
Getting More out of apt
Desktop
OpenSUSE
Command Line
Zypper
Using Zypper
Getting More out of Zypper
Desktop
Exercise
Installing Packages via Command Line
Removing Packages Using the Desktop
Manual Package Installation
RPM
Installing an rpm Package
Uninstalling an rpm Package
Learning More About rpm
Deb
Installing a “deb” Package
Uninstalling a “deb” Package
Learning More About dpkg
Installing Manually Using dnf, apt, and zypper
Dependencies
Installing a Package Using a Package Installation Utility
Removing a Package Using a Package Installation Utility
Exercise
Install figlet Manually
Remove figlet
Repository Configuration
Fedora
Example of a Repository File
Creating Your Own Repository File
List Available Repositories
Ubuntu
Example of a repository file
Repository Lines Explained
Creating Your Own Repository File
List Available Repositories
OpenSUSE
Example of a Repository File
Creating Your Own Repository File
List Available Repositories
System Patching
Errata
Community vs. Enterprise
System Updates
Fedora
Explanation
Ubuntu
Explanation
OpenSUSE
Explanation
Rollback
Fedora
Ubuntu
OpenSUSE
Virtual Machine Snapshots
Creating Snapshots
libvirt Snapshots
Roll Back a Snapshot with libvirt
Exercise
Update Your Linux Environments
Rolling Back
Prerequisite
Tasks
Summary
Chapter 8: Network Configuration
Network Basics in Linux
Network Configuration Using Command Line
Current System Networking Information
ifconfig
ip
Getting More Information
Network Manager
Configure Your Interface Adapter
Set Network During Installation
Manual Configuration
Fedora
Ubuntu
openSUSE
Additional Parameters
Applying Network Configuration
Network Manager
Managed or Not
Fedora
Ubuntu
OpenSUSE
Change Network Configuration with NetworkManager
Network Configuration Using Textual Interfaces
NetworkManager
Network Configuration with Desktop
Fedora
Ubuntu
OpenSUSE
Exercise
Fedora
Ubuntu
OpenSUSE
Network Tools
Default Tools Available
Ping
ss
dig
Exercise
Prerequisites
Network Testing
Summary
Chapter 9: Disk Configuration
Disk Management
Disk Layers
Tools Available
Showing Disks Available
/proc/partitions File
lsblk
Graphical Tools
Disk Names
Adding Disks
Disk Partition Tooling
fdisk
parted
Graphical
Fedora
Ubuntu
OpenSUSE
Exercise
Prerequisites
Create a Partition with “fdisk”
Create a Partition with “parted”
Create a Partition with “YaST Partitioner”
LVM
Installing LVM
Package Name
LVM Utilities
Create
Physical Volume
Volume Group
Logical Volumes
Extending LVM
Extending Physical Volumes
Extending Volume Groups
Extending Logical Volumes
Migrate
Destroy
Delete Physical Volumes
Delete Logical Volumes
Delete Volume Groups
Disaster Recovery
RAID, Mirror, and HA
Exercise
Add Disks
Install LVM
Create LVM Components
Delete and Recover
Filesystem Management
Filesystem Types
Checking Disk Filesystem
Creating
Mounting Filesystems
Mounts Persistent Across Reboots
Resizing
xfs Cannot Shrink
Directory Hierarchy
Exercise
Create Filesystem
Mount Filesystem
Summary
Chapter 10: Service Management
Basic Service Management
Service Management Utilities
chkconfig
systemctl
Web Console
Example Service
Starting a Service
Command Line
Cockpit Web Console
Stopping a Service
Command Line
Cockpit Web Console
Viewing the Status of a Service
Command Line
Cockpit Web Console
Enabling/Disabling a Service
Command Line
Cockpit Web Console
Exercise
Prerequisites
Cockpit
Apache Web Server
Manage httpd Service
Enable and Start
Confirm Service Is Started
Stop and Disable
systemd
Configuration Files
Configuration File Types
Example Configuration File
Configuration File Locations
Changing to and from Graphical Desktops
Utilities
systemctl
journalctl
Other Useful Utilities
Exercise
Basic Service Management
Check Your Default Target
Creating a New Service
Example Script
Unit File
Unit File Explained
Unit Section
Service Section
Install Section
Enable and Start Service
Remove a Service
Exercise
Create a Script
Create a Service
Remove Your Service
Summary
Part IV: Enterprise
Chapter 11: Enterprise Linux Distributions
Red Hat
Brief History
Upstream
RHEL
Red Hat Account
Exercise
Red Hat
Installation Media
Using Installation Media
Virtual Machine
Create a Virtual Machine
RHEL Install
Subscriptions and Support
Subscribing a System
Verify Subscriptions
Register with Red Hat
Attaching Subscriptions
Unregister with Red Hat
Estate Management Basics
Estate Management Tools
Red Hat Satellite Server
Red Hat Automation Platform
Training and Certifications
RHCSA
RHCE
Expertise Exams
Exercise
Virtual Machine
RHEL Server
Register to Red Hat
SUSE Linux Enterprise Server
Brief History
Upstream
SLES
SUSE Account
Exercise
SUSE
Installation Media
Using Installation Media
Virtual Machine
Create a Virtual Machine
Installing SLES
Subscriptions and Support
Subscribing a System
Verify Subscriptions
Register with SUSE
Verify the System Registered with SUSE
Deregister with SUSE
Estate Management Basics
Estate Management Tools
SUSE Manager
SaltStack
Training and Certifications
SCA
SCE
Speciality Exams
Exercise
Virtual Machine
SLES Server
Ubuntu
Brief History
Upstream Is Enterprise
Ubuntu
Training and Certifications
Ubuntu Account
Exercise
Ubuntu
Ubuntu Installation
Estate Management Basics
Estate Management Tools
Landscape
Subscriptions and Support
Subscribing a System
Verify Subscriptions
Register with Ubuntu
Verify the System Registered with SUSE
Detach from the Ubuntu Account
Summary
Chapter 12: Example Use Cases for Linux
Building a Web Server
Web Server Options
Apache httpd
Nginx
Web Server Configuration Overview
Use Case Overview
Design Decision
Linux Distribution
Linux Installation and Configuration
User Account
Subscribe to an Ubuntu Account
Web Server Package Installation
Firewalld
Apache2
Configuration Files
apache2.conf
Included Configuration
Website Configuration
Create Directories
Create Website Files
Site Configuration Files
Firewall Configuration
Firewall Status
Opening Ports
Reload Firewall Configuration
Verify Configuration
SELinux Configuration
No SELinux on Ubuntu
AppArmor
Install SELinux
Activate SELinux
SELinux Permissive First
SELinux Relabel
SELinux Enforcing (Optional)
Set SELinux Labels
Exercise
Prerequisites
Build a Web Server
Success Criteria
Building a File Server
NFS vs. Samba
File Server Configuration Overview
Use Case Overview
NFS Solution
Linux Distribution
Linux Installation and Configuration
User Account
Subscribe to a Red Hat Account
NFS Server Package Installation
Firewalld
nfs-utils
Firewall Configuration
Firewall Status
Opening NFS Ports
Reload Firewall Configuration
Verify Configuration
SELinux Configuration
SELinux Enforcing
Disk to Share
Disk
NFS Server Configuration
Configuration File
/etc/exports
nfs-server Service
Validate Configuration
Test NFS Mounts
NFS Server
Web Server
Exercise
Prerequisites
NFS Server
Web Server
Success Criteria
Summary
Chapter 13: Security
Firewall
Command-Line Configuration
Iptables
Firewalld
Service
Status
Adding Ports and Services
Removing Ports and Services
Cheatsheet
Web UI Configuration
Using Cockpit
Exercise
Firewall Status
Add to Firewall
Learning More About Firewall Services
Remove from Firewall
SELinux
SELinux Modes
Command-Line Configuration
SELinux Mode
SELINUX
SELINUXTYPE
SELinux Commands
getenforce
setenforce
Listing SELinux Labels
SELinux Context Labels
Listing Context Labels
Setting Context Labels
chcon
semanage
SELinux Booleans
getsebool
setsebool
SELinux Debugging
Journalctl
Ausearch
/var/log/messages
Cheatsheet
Exercise
Setting SELinux Modes
List SELinux Booleans
Web Server and SELinux
Hardening
Hardening Standards
Center for Internet Security (CIS)
Security Technical Implementation Guide (STIG)
Compliance Scanning
OpenSCAP
Installation
Running Vulnerability Scans
OpenSCAP Profiles
Available Profiles
Profile Information
Running a Scan with a Profile
Remediation
Automated Remediation
Exercise
Prerequisites
Compliance Scans
Remediate
Encryption
How Does Encryption Work
Linux Encryption
SSH Keys
Asymmetric Encryption
Generate ssh Keys
Different Algorithm
Using ssh Keys
Manual Configuration
Disk Encryption
Cryptsetup
Create a LUKS Encrypted Disk
Decrypting a LUKS Disk
Encrypted Disk Status
Formatting an Encrypted Disk
Mounting an Encrypted Disk
Persistent Mounting
Network Encryption
VPN
Create a VPN Connection
Certificates
What Are Certificates Used For
SSL and TLS
Certificate Authority
Manual Certificate Generation
Automated Certificate Generation
Exercise
SSH Keys
Encrypted Disk
Generate a csr
Summary
Chapter 14: High Availability
Clustering
Types
High Availability
Load Balancing
Distributed
High Performance
Cluster Concepts
Enterprise Linux Clustering
Projects
Corosync
Pacemaker
RHEL Cluster Example
Prerequisites
Configuration Requirements
Static IP Addresses
Hostname Resolution
NTP
Communication Between Nodes
Subscribe to Subscription
Cluster Installation
Install Packages
Firewall Rules
Cluster User Account
Cluster Services
Cluster Setup
Authorize Nodes
Form the Cluster
Cluster Quorum
Cluster Status
Fencing
KVM Fencing
Node Fencing
Cluster Resources
Virtual IP Address
Web Server
Fixing the Cluster
Removing resource
Group Resources
Cluster Status
Cluster Troubleshooting
Logs
Official Documentation
Official Training
Exercise
Prerequisites
Build a Cluster
Success Criteria
Summary
Chapter 15: Scripting and Automation
Shell Scripting
Linux Shell
Shell Environments
Check Your Shell Environment
Change Shell Environments
Shell Scripting Basics
Before Writing a Script
Is a Script Needed?
Does This Already Exist?
Keep It Simple
Script Structure
Interpreters
Variables
Setting Variables
Variable Names
Special Variables
Variable Arithmetic
Script Body
Conditionals
Conditional Operands
Loops
Examples
Create Directory
Package Installation
Exercise
Create Users
Packages Managed
Ansible
Explained
Control Node
Managed Nodes
Inventory
Playbooks
Roles
Modules
Plug-ins
Collections
Ansible Configuration
Control Node
Setup ssh Keys
Ansible Configuration Files
Hierarchy
Creating Ansible Content
Inventory File
Playbook
Execute Playbook
Role
Ansible Galaxy
Variable Files
Custom Variables
Group_vars
Host_vars
Using Variables
Ansible Documentation
Exercise
Ansible Environment
Create a Playbook
Create a Variable File
Bonus Task
Summary
Chapter 16: Deployment at Scale
Deployment Methods
Kickstart
Create Kickstart File
Copy Kickstart File to Web Server
Build a New System
Official Documentation
Image Cloning
Kickstart vs. Cloning
Exercise
Prerequisite
Create a Kickstart File
Build RHEL 9 Using Kickstart
Clone a VM
Deployment Tools
Enterprise Deployment Tools
Foreman
Red Hat Satellite Server
Subscription Required
Installing Red Hat Satellite Server
Uyuni
SUSE Manager
Automation
Ansible
Red Hat Enterprise Version
Community Ansible
SaltStack
Puppet
Terraform
How to Get Terraform
Training and Certifications
Red Hat
SUSE
Summary
Part V: Troubleshooting and Recovery
Chapter 17: Troubleshooting Linux
Logging
Logs
Where Logs Are Located
Rsyslog
Installation
Configuration File
Global Directives
Templates
Rules
Verbosity
Log Detail Levels
Set Log Level
Don’t Leave Debugging On
Understanding Errors
Tail Logs as You Work
Journalctl
Real-Time Messages
Useful journalctl Commands
Remote Logging
Rsyslog as a Central Logging System
Firewall
SELinux
rsyslog.conf
Restart Service
Forward Logs to Rsyslog server
Restart Service
Exercise
Journalctl
Logs
Remote Logging
Monitoring
Process-Related Tools
ps and top
top
ps
pstree
Disk-Related Tools
lsblk
blkid
du
df
Network-Related Tools
ss
Additional Network Tools
Performance Copilot
Remote Monitoring
Nagios
Prometheus
Finding Help
Tools
strace
Manual Pages and Help
Asking for Help
Before Asking for Help
Asking a Question the Right Way
Be Very Clear
Question Wording
Example Questions
Bad Question
Good Question
Getting Support
Preempted Support
Sosreport
Summary
Chapter 18: Recovering from Disaster
Reinstalling
Things to Consider
Cattle vs. Pets
Time to Build vs. Time to Troubleshoot
Build from Code
Knowing When to Start Over
Recovering
Single-User Mode
RHEL
Ubuntu
SLES
Emergency vs. Rescue Mode
Using Rescue Disks
Rescue Examples
Root Password Reset
Kernel Issues
Use Old Kernel
Rescue Disk and Install New Kernel
Resolving Mount Issues
Exercise
Boot into Emergency Mode
Boot into Rescue Mode
Fix the Root Password
Boot into a Second Kernel
Summary
Chapter 19: Backup and Restore
Backups
Backup Methods
Filesystem Backups
When to Back Up
Tools
What to Back Up
Where to Back Up
Network Considerations
Network Mounts
Virtual Machine Backups
Snapshots
Backup VM Files
Storage Backups
Backup Reports
Restore
What to Restore
Test Restore
Summary
Index