Practical Linux System Administration

Book description

This essential guide covers all aspects of Linux system administration, from user maintenance, backups, filesystem housekeeping, storage management, and network setup to hardware and software troubleshooting and some application management. It's both a practical daily reference manual for sysadmins and IT pros and a handy study guide for those taking Linux certification exams.

You'll turn to it frequently, not only because of the sheer volume of valuable information it provides but because of the real-world examples within and the clear, useful way the information is presented. With this book at your side, you'll be able to:

  • Install Linux and perform initial setup duties, such as connecting to a network
  • Navigate the Linux filesystem via the command line
  • Install software from repositories and source and satisfy dependencies
  • Set permissions on files and directories
  • Create, modify, and remove user accounts
  • Set up networking
  • Format and mount filesystems
  • Perform basic troubleshooting on hardware and software
  • Create and manage logical volumes
  • Work with SELinux
  • Manage a firewall and iptables
  • Shut down, reboot, and recover a system
  • Perform backups and restores

Publisher resources

View/Submit Errata

Table of contents

  1. Preface
    1. Who Should Read This Book
    2. Why I Wrote This Book
    3. Navigating This Book
    4. Conventions Used in This Book
    5. Using Code Examples
    6. O’Reilly Online Learning
    7. How to Contact Us
    8. Acknowledgments
  2. 1. Getting Started with Linux
    1. Installing Linux
      1. Preparing Your System for Linux
      2. Downloading and Installing Linux
    2. Getting to Know Your New Linux System
    3. Learning the CLI
      1. pwd
      2. cd
      3. ls
    4. Starting, Rebooting, and Shutting Down a Linux System
      1. Starting a System
      2. Restarting a System
      3. Shutting Down a System
    5. Summary
  3. 2. Working with Permissions and Privileged Accounts
    1. Working as a Regular User
    2. Working as the Root User
      1. Logging in as Root
      2. Using the su Command
      3. Using the sudo Command
      4. Creating a Sudoer
    3. Reading and Modifying Permissions
      1. Read, Write, and Execute
      2. Numerical Permission Values
      3. Group Permissions
      4. Bringing Permissions into Focus
    4. Changing File Permissions
      1. Symbolic Mode
      2. Numeric Mode
      3. Default Permissions Explained: umask
    5. Summary
  4. 3. Customizing the User Experience
    1. Altering Home Directory Options
      1. Login Versus Nonlogin Shells
      2. /etc/bashrc
      3. /etc/profile
      4. .bashrc
      5. .bash_profile
      6. .bash_logout
    2. The /etc/skel Directory
    3. Customizing the Shell Prompt
    4. Summary
  5. 4. Managing Users
    1. User and Group ID Numbering Conventions
    2. Creating User Accounts
      1. Adding Users with useradd
      2. Adding Users with adduser
    3. Modifying User Accounts
      1. Adding a Supplementary Group
      2. Changing the User Comments Field
      3. Setting an Expiration (Expiry) Date on an Account
      4. Changing a User’s Login Shell
    4. Removing User Accounts
    5. Forcing Password Changes
    6. Handling Service Accounts
    7. Managing Groups Rather Than Users
    8. Summary
  6. 5. Connecting to a Network
    1. Plugging into a Network
      1. Static IP Addressing
      2. Dynamic IP Addressing
    2. Networking and Security
      1. Preparing a System for Network Connectivity
      2. Pruning Your Systems
      3. Securing Network Daemons
      4. The Secure Shell Daemon
    3. Summary
  7. 6. Installing and Uninstalling Software
    1. Updating Your System
      1. Applying Red Hat Enterprise Linux–Based System Updates
      2. Applying Debian-Based System Updates
    2. Installing Software from Repositories
      1. Installing an Application
      2. Uninstalling an Application
    3. Installing and Uninstalling Individual Software Packages
      1. Installing an Individual Software Package Manually
      2. Uninstalling Individual Software Packages
      3. Finding Package Dependencies
    4. Installing Software from Source Code
      1. Satisfying Prerequisites: Building a Development Environment
      2. Download, Extract, Compile, and Install Your Software
      3. Uninstalling a Source-Installed Software Package
    5. Summary
  8. 7. Managing Storage
    1. Administering Linux Storage
      1. Disks
      2. Filesystems
      3. Mounting and Mount Points
      4. Physical and Logical Volumes
      5. Checking Space
      6. Swap Space
      7. RAM-Based Temporary Space (ramfs and tmpfs)
    2. Adding a New Disk to a System
      1. Installing the Disk
      2. Prepping the Disk for Use
      3. Implementing Logical Volumes
    3. Decommissioning and Disk Disposal
      1. Notification
      2. Scream Test
      3. Power Down
      4. Disk Wiping
      5. Unracking and Palletizing
      6. Disposal
    4. Summary
  9. 8. Maintaining System Health
    1. Keeping Your System Clutter-Free
      1. Cleaning the /tmp Directory
      2. Making /home a Livable Space for Everyone
    2. Decluttering Shared Directories
      1. Deduplicating Files with fdupes
      2. Tackling /home File Sprawl with Quotas
    3. Patching Your Way to a Healthy System
      1. Patching a Red Hat Enterprise Linux–Based System
      2. Patching a Debian-Based Linux System
    4. Securing Your Systems
    5. Maintaining User and Group Accounts
      1. Setting Up a Naming Convention
      2. Creating Account Retention Policies
      3. Retiring Group Accounts
    6. Monitoring System Health
      1. Gathering System Activity Reports
      2. Formatting System Activity Reports
    7. Summary
  10. 9. Monitoring Your System
    1. Maintaining Vigilance on CPU, Memory, and Disk Performance and Capacity
      1. Tracking CPU Usage
      2. Exploring sysstat Monitoring
        1. Reporting System Activity
        2. Displaying System Activity Data in Multiple Formats
        3. Monitoring System I/O Device Loading with iostat
        4. Kicking It Old-School with the tapestat Utility
        5. Collecting Processor Statistics
        6. Monitoring Linux Tasks with pidstat
        7. Watching Windows-Compatible Filesystem Statistics with cifsiostat
    2. Summary
  11. 10. Scripting and Automation
    1. Answering the Question: Why Automate?
    2. Automating Yourself Out of a Job
    3. Creating Scripts
      1. Outlining Your Scripts
      2. Writing a Script from an Outline
    4. Scheduling Tasks
      1. Using cron to Schedule Tasks
      2. Preventing Time Drift with the Network Time Protocol
    5. Summary
  12. 11. Deploying Samba for Windows Compatibility
    1. Planning Your Samba Environment
      1. Installing Samba and Its Dependencies
      2. Adding Samba Users to Your System
      3. Managing Samba Users as a Group
    2. Providing Services to Mac and Windows Clients
      1. Serving Network Storage to Desktop Clients
      2. Configuring a Shared Directory
      3. Browsing for Shared Directories
      4. Mounting Windows System’s Shares
    3. Summary
  13. 12. Troubleshooting Linux
    1. Reviving the Operating System
      1. De-escalating a Kernel Panic
      2. Scraping System Logs
    2. Unraveling Software Problems
      1. Inspecting System Logs
      2. Checking Application Logs
      3. Leveraging Internal Application Checks
      4. Managing Firewalls and Their Rules
      5. Removing and Reinstalling Software
      6. Rebooting Your System
    3. Dealing with Hardware Failures
      1. Preemptively Troubleshooting Hardware
      2. Gathering System Hardware Information
    4. Creating Automated Security Checks
    5. Summary
  14. 13. Securing Your System
    1. Protecting the Root Account
    2. Finding the Balance Between Security and Usability
      1. Minimizing Your System’s Attack Surface
      2. Creating and Securing User Accounts
    3. Implementing Advanced Security Measures
      1. Applying STIG Security Controls
      2. Installing and Using Security Tools
    4. Responding to Security Incidents
      1. Creating a Written Security Policy
      2. Confirming the Breach
      3. Identifying the Malicious Actor(s)
      4. Taking Corrective Actions
    5. Summary
  15. 14. Continuing Your Education
    1. Training Internally
    2. Seeking Certification
      1. Preparing for a Certification Exam
      2. Taking the Exam
    3. Educating Yourself
    4. Formalizing Your Education
    5. Using Your Job as Education
    6. Summary
  16. 15. Making Career Moves
    1. Starting Your Own Business
      1. Facing Self-Employment Realities
      2. Managing Employees
      3. Hiring Contractors
    2. Moving into Corporate Management
      1. Challenging Yourself
      2. Managing Your New Role
    3. Changing with the Job Market
      1. Searching Online Job Boards
      2. Working Remotely
      3. Learning How to Communicate
    4. Leaving Your Current Position
      1. Writing the Resignation Letter
      2. Leaving Your Job
    5. Summary
  17. Index
  18. About the Author

Product information

  • Title: Practical Linux System Administration
  • Author(s): Kenneth Hess
  • Release date: April 2023
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781098109035