0%

This is the third edition of the bestselling one-stop resource for sysadmins and DevOps professionals to learn, configure and use Ubuntu 20.04 for their day-to-day operations and deployments.

Key Features

  • A hands-on book that will teach you how to deploy, maintain and troubleshoot Ubuntu Server
  • Learn to leverage the improved performance and security-related aspects of Ubuntu Server 20.04 LTS
  • New chapters dedicated to exploring Ubuntu for cloud

Book Description

Ubuntu Server has taken data centers around the world by storm. Whether you're deploying Ubuntu for a large-scale project or for a small office, it is a stable, customizable, and powerful Linux distribution with innovative and cutting-edge features. For both simple and complex server deployments, Ubuntu's flexible nature can be easily adapted to meet to the needs of your organization.

This third edition is updated to cover the advancements of Ubuntu 20.04 LTS and further train you to understand how to use Ubuntu Server, from initial deployment to creating production-ready resources for your network. The book begins with the concepts of user management, group management, and file system permissions. Continuing into managing storage volumes, you will learn how to format storage devices, utilize logical volume management, and monitor disk usage. Later, you will learn how to virtualize hosts and applications, which will include setting up QEMU & KVM, as well as containerization with both Docker and LXD. As the book continues, you will learn how to automate configuration with Ansible, as well as take a look at writing scripts. Lastly, you will explore best practices and troubleshooting techniques when working with Ubuntu Server that are applicable to real-world scenarios.

By the end of this Ubuntu Server book, you will be well-versed in Ubuntu server's advanced concepts and attain the required proficiency needed for Ubuntu Server administration.

What you will learn

  • Manage users, groups, and permissions
  • Optimize the performance of system resources
  • Perform disk encryption and decryption with Linux Unified Key Setup (LUKS)
  • Set up Secure Shell (SSH) for remote access, and connect it to other nodes
  • Share directories using Samba and Network File System (NFS)
  • Get familiar with scripting to improve command-line efficiency
  • Configure VMs, containers, and orchestrate with MicroK8s and Kubernetes
  • Automate server deployments with Ansible and cloud server deployments with Terraform

Who this book is for

The book is written to cater to sysadmins and DevOps professionals whose teams are planning to employ an Ubuntu/Linux environment for their development needs.

Prior knowledge of Ubuntu is not required. However, it is assumed that you possess some IT admin, Linux, and shell scripting experience.

Table of Contents

  1. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Get in touch
  2. Deploying Ubuntu Server
    1. Technical requirements
    2. Determining your server's role
    3. Setting up our server
    4. Virtual machine
    5. Physical server
    6. Virtual private server
    7. Spare desktop or laptop
    8. Raspberry Pi
    9. Obtaining installation media
    10. Creating a bootable flash drive
    11. Planning the partitioning layout
    12. Installing Ubuntu Server
    13. Installing media
    14. Customizing the installation
    15. Configuring the server's disk
    16. Creating the initial user account
    17. Installing Ubuntu on a Raspberry Pi
    18. Summary
    19. Further Reading
  3. Managing Users and Permissions
    1. Understanding users and groups
    2. Understanding when to use root
    3. Using sudo to run privileged commands
    4. Creating and removing users
    5. Using useradd
    6. Using adduser
    7. Removing users
    8. Understanding the /etc/passwd and /etc/shadow files
    9. Using /etc/passwd
    10. Using /etc/shadow
    11. Distributing default configuration files with /etc/skel
    12. Switching users
    13. Managing groups
    14. Managing passwords and password policies
    15. Locking and unlocking user accounts
    16. Setting password expiration information
    17. Setting a password policy
    18. Configuring administrator access with sudo
    19. Setting permissions on files and directories
    20. Viewing permissions
    21. Changing permissions
    22. Changing the ownership of objects
    23. Summary
    24. Further reading
  4. Managing Software Packages
    1. Understanding Linux package management
    2. Understanding the differences between Debian and Snap packages
    3. Debian packages
    4. Snap packages
    5. Installing and removing software
    6. Managing Debian packages with apt
    7. Managing Snap packages with snap
    8. Searching for packages
    9. Managing package repositories
    10. Adding additional repositories
    11. Adding Personal Package Archives
    12. Backing up and restoring Debian packages
    13. Cleaning up orphaned apt packages
    14. Taking advantage of hardware enablement updates
    15. Summary
    16. Further reading
  5. Navigating and Essential Commands
    1. Learning essential Linux commands
    2. Understanding the Linux filesystem layout
    3. Viewing the contents of files
    4. Viewing application log files
    5. Summary
    6. Further reading
  6. Managing Files and Directories
    1. Copying, moving, and renaming files and directories
    2. Editing files with the Nano and Vim text editors
    3. Editing with Nano
    4. Editing with Vim
    5. Input and output streams
    6. Using symbolic and hard links
    7. Summary
    8. Further reading
  7. Boosting Your Command-line Efficiency
    1. Understanding the Linux shell
    2. Understanding Bash history
    3. Learning some useful command-line tricks
    4. Understanding variables
    5. Writing simple scripts
    6. Putting it all together – Writing an rsync backup script
    7. Summary
    8. Further reading
  8. Controlling and Managing Processes
    1. Managing jobs
    2. Understanding the ps command
    3. Viewing running processes with ps
    4. Configuring arguments to ps
    5. Changing the priority of processes
    6. Dealing with misbehaving processes
    7. Managing system processes
    8. Scheduling tasks with cron
    9. Summary
    10. Further reading
  9. Monitoring System Resources
    1. Viewing disk usage
    2. Using df
    3. Diving deeper into disk usage
    4. Monitoring memory usage
    5. Understanding server memory
    6. Managing swap
    7. Understanding load average
    8. Viewing resource usage with htop
    9. Summary
    10. Further reading
  10. Managing Storage Volumes
    1. Adding additional storage volumes
    2. Formatting and partitioning storage devices
    3. Creating a partition
    4. Formatting partitions
    5. Mounting and unmounting volumes
    6. Understanding the /etc/fstab file
    7. Analyzing the contents of /etc/fstab
    8. Adding to the /etc/fstab file
    9. Backing up and restoring volumes
    10. Utilizing LVM
    11. Getting started with LVM
    12. Formatting logical volumes
    13. Removing volumes with LVM
    14. Understanding LVM snapshots
    15. Summary
    16. Further reading
  11. Connecting to Networks
    1. Setting the hostname
    2. Managing network interfaces
    3. Assigning static IP addresses
    4. Understanding Linux name resolution
    5. Getting started with OpenSSH
    6. Installing OpenSSH
    7. Issuing commands with OpenSSH
    8. Getting started with SSH key management
    9. Generating public and private keys
    10. Copying your public key to a remote server
    11. Utilizing an SSH agent
    12. Changing the passphrase of an OpenSSH key
    13. Simplifying SSH connections with a config file
    14. Summary
    15. Further reading
  12. Setting Up Network Services
    1. Planning your IP address scheme
    2. Setting up a DHCP server for serving IP addresses
    3. Adding a DNS server
    4. Setting up external DNS with bind
    5. Setting up internal DNS and adding hosts
    6. Setting up an internet gateway
    7. Keeping your clock in sync with NTP
    8. Summary
    9. Further reading
  13. Sharing and Transferring Files
    1. File server considerations
    2. Sharing files with Windows users via Samba
    3. Setting up NFS shares
    4. Transferring files with rsync
    5. Transferring files with SCP
    6. Mounting remote directories with SSHFS
    7. Summary
    8. Further reading
  14. Managing Databases
    1. Preparations for setting up a database server
    2. Installing MariaDB
    3. Understanding the MariaDB configuration files
    4. Managing MariaDB databases
    5. Setting up a secondary database server
    6. Summary
    7. Further reading
  15. Serving Web Content
    1. Installing and configuring Apache
    2. Installing additional Apache modules
    3. Securing Apache with TLS
    4. Installing and configuring NGINX
    5. Setting up failover with keepalived
    6. Setting up and configuring Nextcloud
    7. Summary
    8. Further reading
  16. Automating Server Configuration with Ansible
    1. Understanding the need for configuration management
    2. Why Ansible?
    3. Creating a Git repository
    4. Getting started with Ansible
    5. Making your servers do your bidding
    6. Setting up an inventory file and configuring Ansible settings
    7. Configuring client servers
    8. Putting it all together – automating web server deployment
    9. Using Ansible's pull method
    10. Summary
    11. Further reading
  17. Virtualization
    1. Prerequisites and considerations
    2. Setting up a virtual machine server
    3. Creating virtual machines
    4. Bridging the virtual machine network
    5. Simplifying virtual machine creation with cloning
    6. Managing virtual machines via the command line
    7. Summary
    8. Further reading
  18. Running Containers
    1. What is containerization?
    2. Understanding the differences between Docker and LXD
    3. Installing Docker
    4. Managing Docker containers
    5. Automating Docker image creation with Dockerfiles
    6. Managing LXD containers
    7. Summary
    8. Further reading
  19. Container Orchestration
    1. Container orchestration
    2. Preparing a lab environment for Kubernetes testing
    3. Utilizing MicroK8s
    4. Installing MicroK8s on Linux
    5. Installing MicroK8s on macOS
    6. Installing MicroK8s on Windows
    7. Interacting with MicroK8s
    8. Setting up a Kubernetes cluster
    9. Configuring Docker
    10. Testing Docker
    11. Installing Kubernetes
    12. Deploying containers via Kubernetes
    13. Summary
    14. Further reading
  20. Deploying Ubuntu in the Cloud
    1. Understanding the difference between on-premises and cloud infrastructure
    2. Important considerations when considering cloud computing as a potential solution
    3. Becoming familiar with some basic AWS concepts
    4. Creating an AWS account
    5. Signing up for AWS
    6. Implementing basic user security
    7. Choosing a region
    8. Deploying Ubuntu as an AWS EC2 instance
    9. Setting up an IAM Role for Session Manager
    10. Creating an Ubuntu Server instance in AWS
    11. Creating and deploying Ubuntu AMI images
    12. Automatically scaling Ubuntu EC2 deployments with Auto Scaling
    13. Creating a launch template
    14. Creating an Auto Scaling group
    15. Creating a load balancer
    16. Keeping costs down: understanding how to save money and make cost-effective decisions
    17. Viewing billing information
    18. Adding a billing alert
    19. Removing unneeded backups
    20. Running EC2 instances only when they're needed
    21. Stopping or terminating unneeded EC2 instances
    22. Taking cloud further: additional resources to grow your knowledge
    23. Online training and labs
    24. Certification
    25. Keep experimenting and learning
    26. AWS documentation
    27. Summary
    28. Further reading
  21. Automating Cloud Deployments with Terraform
    1. Why it's important to automate your infrastructure
    2. Introduction to Terraform and how it can fit within your workflow
    3. Installing Terraform
    4. Automating an EC2 instance deployment
    5. Managing security groups with Terraform
    6. Using Terraform to destroy unused resources
    7. Combining Ansible with Terraform for a full deployment solution
    8. Summary
  22. Securing Your Server
    1. Lowering your attack surface
    2. Understanding and responding to CVEs
    3. Installing security updates
    4. Automatically installing patches with the Canonical Livepatch service
    5. Monitoring Ubuntu servers with Canonical's Landscape service
    6. Securing OpenSSH
    7. Installing and configuring Fail2ban
    8. MariaDB best practices for secure database servers
    9. Setting up a firewall
    10. Encrypting and decrypting disks with LUKS
    11. Locking down sudo
    12. Summary
    13. Further reading
  23. Troubleshooting Ubuntu Servers
    1. Evaluating the scope
    2. Conducting a root cause analysis
    3. Viewing system logs
    4. Tracing network issues
    5. Troubleshooting resource issues
    6. Diagnosing defective RAM
    7. Summary
    8. Further reading
  24. Preventing Disasters
    1. Preventing disasters
    2. Utilizing Git for configuration management
    3. Implementing a backup plan
    4. Replacing failed RAID disks
    5. Utilizing bootable recovery media
    6. Summary
    7. Further reading
  25. Another Book You May Enjoy
  26. Index
18.222.184.162