Ubuntu 20.04 Essentials

Book description

Explore the potential of Ubuntu 20.04 to manage your local machine and external servers with ease

Key Features

  • Learn how to install Ubuntu on a clean disk drive and with the network installer
  • Find out how to set up a firewall to protect your system from vulnerable attacks
  • Explore file-sharing services such as Samba and NFS to share files from Ubuntu to third-party systems

Book Description

Ubuntu is undeniably one of the most highly regarded and widely used Debian-based Linux distributions available today. Thanks to its ease of use and reliability, Ubuntu has a loyal following of Linux users and an active community of developers.

Ubuntu 20.04 Essentials is designed to take you through the installation, use, and administration of the Ubuntu 20.04 distribution in detail. For beginners, the book covers topics such as operating system installation, the basics of the GNOME desktop environment, configuring email and web servers, and installing packages and system updates. Additional installation topics such as dual booting with Microsoft Windows are also covered along with crucial security topics such as configuring a firewall and user and group administration.

For the experienced user, the book delves into topics such as remote desktop access, the Cockpit web interface, logical volume management (LVM), disk partitioning, and swap management. Further, it also explores KVM virtualization, Secure Shell (SSH), Linux containers, and file sharing using both Samba and NFS to provide a thorough overview of this enterprise-class operating system.

What you will learn

  • Get to grips with the process of installing and booting Ubuntu
  • Configure SSH key-based authentication on Ubuntu
  • Create KVM virtual machines using Cockpit and the Virtual Machine Manager (VMM)
  • Install, run, and manage containers on Ubuntu
  • Send and receive emails using a third-party SMTP relay server
  • Add a new disk to an Ubuntu volume group and logical volume

Who this book is for

If you are into network engineering or system administration or are a Linux enthusiast looking to get hands-on with Ubuntu 20.04 to manage local and virtual machines, this book is for you. A solid understanding of basic Linux commands and knowledge of Ubuntu is recommended.

Table of contents

  1. 1. Introduction
    1. 1.1 Superuser Conventions
    2. 1.2 Opening a Terminal Window
    3. 1.3 Editing Files
    4. 1.4 Feedback
    5. 1.5 Errata
  2. 2. A Brief History of Linux
    1. 2.1 What exactly is Linux?
    2. 2.2 UNIX Origins
    3. 2.3 Who Created Linux?
    4. 2.4 The History of Ubuntu
    5. 2.5 What does the word “Ubuntu” Mean?
    6. 2.6 Summary
  3. 3. Installing Ubuntu on a Clean Disk Drive
    1. 3.1 Ubuntu Installation Options
    2. 3.2 Server vs. Desktop Editions
    3. 3.3 Obtaining the Ubuntu Installation Media
    4. 3.4 Writing the ISO Installation Image to a USB Drive
      1. 3.4.1 Linux
      2. 3.4.2 macOS
      3. 3.4.3 Windows
    5. 3.5 Booting from the Ubuntu USB Image
    6. 3.6 Installing Ubuntu
    7. 3.7 Accessing the Ubuntu Desktop
    8. 3.8 Installing Updates
    9. 3.9 Displaying Boot Messages
    10. 3.10 Summary
  4. 4. Installing Ubuntu with the Network Installer
    1. 4.1 Network Installer Advantages
    2. 4.2 Obtaining the Network Installer Image
    3. 4.3 Booting from the Installer Image
    4. 4.4 Performing the Installation
    5. 4.5 Disk Partitioning
    6. 4.6 Software Collection Selection
    7. 4.7 Installing Software Collections After System Setup
    8. 4.8 Summary
  5. 5. Dual Booting Ubuntu with Windows
    1. 5.1 Beginning the Ubuntu Installation
    2. 5.2 Booting Ubuntu for the First Time
    3. 5.3 Changing the Default Boot Option
    4. 5.4 Accessing the Windows Partition from the Command-line
    5. 5.5 Accessing the Windows Partition from the Desktop
    6. 5.6 Summary
  6. 6. Allocating Windows Disk Partitions to Ubuntu
    1. 6.1 Unmounting the Windows Partition
    2. 6.2 Deleting the Windows Partitions from the Disk
    3. 6.3 Formatting the Unallocated Disk Partition
    4. 6.4 Mounting the New Partition
    5. 6.5 Editing the Boot Menu
    6. 6.6 Using the GNOME Disks Utility
    7. 6.7 Summary
  7. 7. A Guided Tour of the GNOME 3 Desktop
    1. 7.1 Installing the GNOME Desktop
    2. 7.2 An Overview of the GNOME 3 Desktop
    3. 7.3 Launching Activities
    4. 7.4 Managing Windows
    5. 7.5 Using Workspaces
    6. 7.6 Calendar and Notifications
    7. 7.7 Desktop Settings
    8. 7.8 Customizing the Dash
    9. 7.9 Switching to Dark Mode
    10. 7.10 Installing Ubuntu Software
    11. 7.11 Beyond Basic Customization
    12. 7.12 Summary
  8. 8. An Overview of the Ubuntu Cockpit Web Interface
    1. 8.1 An Overview of Cockpit
    2. 8.2 Installing and Enabling Cockpit
    3. 8.3 Accessing Cockpit
    4. 8.4 Overview
    5. 8.5 Logs
    6. 8.6 Storage
    7. 8.7 Networking
    8. 8.8 Accounts
    9. 8.9 Services
    10. 8.10 Applications
    11. 8.11 Virtual Machines
    12. 8.12 Software Updates
    13. 8.13 Terminal
    14. 8.14 Connecting to Multiple Servers
    15. 8.15 Summary
  9. 9. Using the Bash Shell on Ubuntu
    1. 9.1 What is a Shell?
    2. 9.2 Gaining Access to the Shell
    3. 9.3 Entering Commands at the Prompt
    4. 9.4 Getting Information about a Command
    5. 9.5 Bash Command-line Editing
    6. 9.6 Working with the Shell History
    7. 9.7 Filename Shorthand
    8. 9.8 Filename and Path Completion
    9. 9.9 Input and Output Redirection
    10. 9.10 Working with Pipes in the Bash Shell
    11. 9.11 Configuring Aliases
    12. 9.12 Environment Variables
    13. 9.13 Writing Shell Scripts
    14. 9.14 Summary
  10. 10. Managing Ubuntu Users and Groups
    1. 10.1 User Management from the Command-line
    2. 10.2 User Management with Cockpit
    3. 10.3 User Management using the Settings App
    4. 10.4 Summary
  11. 11. Managing Ubuntu systemd Units
    1. 11.1 Understanding Ubuntu systemd Targets
    2. 11.2 Understanding Ubuntu systemd Services
    3. 11.3 Ubuntu systemd Target Descriptions
    4. 11.4 Identifying and Configuring the Default Target
    5. 11.5 Understanding systemd Units and Unit Types
    6. 11.6 Dynamically Changing the Current Target
    7. 11.7 Enabling, Disabling and Masking systemd Units
    8. 11.8 Working with systemd Units in Cockpit
    9. 11.9 Summary
  12. 12. Ubuntu Software Package Management and Updates
    1. 12.1 Repositories
    2. 12.2 Managing Repositories with Software & Updates
    3. 12.3 Managing Packages with APT
    4. 12.4 Performing Updates
    5. 12.5 Enabling Automatic Updates
    6. 12.6 Enabling Livepatch
    7. 12.7 Summary
  13. 13. Ubuntu Snap Package Management
    1. 13.1 Managing Software with Snap
    2. 13.2 Basic Snap Commands
    3. 13.3 Working with Snap Channels
    4. 13.4 Snap Refresh Schedule
    5. 13.5 Snap Services
    6. 13.6 Summary
  14. 14. Ubuntu Network Management
    1. 14.1 An Introduction to NetworkManager
    2. 14.2 Installing and Enabling NetworkManager
    3. 14.3 Basic nmcli Commands
    4. 14.4 Working with Connection Profiles
    5. 14.5 Interactive Editing
    6. 14.6 Configuring NetworkManager Permissions
    7. 14.7 Summary
  15. 15. Ubuntu Firewall Basics
    1. 15.1 Understanding Ports and Services
    2. 15.2 Securing Ports and Services
    3. 15.3 Ubuntu Services and iptables Rules
    4. 15.4 Well Known Ports and Services
    5. 15.5 Summary
  16. 16. Using gufw and ufw to Configure an Ubuntu Firewall
    1. 16.1 An Overview of gufw and ufw
    2. 16.2 Installing gufw on Ubuntu
    3. 16.3 Running and Enabling gufw
    4. 16.4 Creating a New Profile
    5. 16.5 Adding Preconfigured Firewall Rules
    6. 16.6 Adding Simple Firewall Rules
    7. 16.7 Adding Advanced Rules
    8. 16.8 Configuring the Firewall from the Command Line using ufw
    9. 16.9 Summary
  17. 17. Basic Ubuntu Firewall Configuration with firewalld
    1. 17.1 An Introduction to firewalld
      1. 17.1.1 Zones
      2. 17.1.2 Interfaces
      3. 17.1.3 Services
      4. 17.1.4 Ports
    2. 17.2 Checking firewalld Status
    3. 17.3 Configuring Firewall Rules with firewall-cmd
      1. 17.3.1 Identifying and Changing the Default Zone
      2. 17.3.2 Displaying Zone Information
      3. 17.3.3 Adding and Removing Zone Services
      4. 17.3.4 Working with Port-based Rules
      5. 17.3.5 Creating a New Zone
      6. 17.3.6 Changing Zone/Interface Assignments
      7. 17.3.7 Masquerading
      8. 17.3.8 Adding ICMP Rules
      9. 17.3.9 Implementing Port Forwarding
    4. 17.4 Managing firewalld using firewall-config
    5. 17.5 Summary
  18. 18. Configuring SSH Key-based Authentication on Ubuntu
    1. 18.1 An Overview of Secure Shell (SSH)
    2. 18.2 SSH Key-based Authentication
    3. 18.3 Setting Up Key-based Authentication
    4. 18.4 Installing and Starting the SSH Service
    5. 18.5 SSH Key-based Authentication from Linux and macOS Clients
    6. 18.6 Managing Multiple Keys
    7. 18.7 SSH Key-based Authentication from Windows 10 Clients
    8. 18.8 SSH Key-based Authentication using PuTTY
    9. 18.9 Generating a Private Key with PuTTYgen
    10. 18.10 Installing the Public Key for a Google Cloud Instance
    11. 18.11 Summary
  19. 19. Ubuntu Remote Desktop Access with Vino
    1. 19.1 Remote Desktop Access Types
    2. 19.2 Secure and Insecure Remote Desktop Access
    3. 19.3 Enabling Remote Desktop Access on Ubuntu
    4. 19.4 Connecting to the Shared Desktop
    5. 19.5 Connecting from Non-Linux Clients
    6. 19.6 Establishing a Secure Remote Desktop Session
    7. 19.7 Establishing a Secure Tunnel on Windows using PuTTY
    8. 19.8 Summary
  20. 20. Ubuntu Remote Desktop Access with VNC
    1. 20.1 Installing the GNOME Desktop Environment
    2. 20.2 Installing VNC on Ubuntu
    3. 20.3 Configuring the VNC Server
    4. 20.4 Starting the VNC Server
    5. 20.5 Connecting to a VNC Server
    6. 20.6 Summary
  21. 21. Displaying Ubuntu Applications Remotely (X11 Forwarding)
    1. 21.1 Requirements for Remotely Displaying Ubuntu Applications
    2. 21.2 Remotely Displaying an Ubuntu Application
    3. 21.3 Trusted X11 Forwarding
    4. 21.4 Compressed X11 Forwarding
    5. 21.5 Displaying Remote Ubuntu Apps on Windows
    6. 21.6 Summary
  22. 22. Using NFS to Share Ubuntu Files with Remote Systems
    1. 22.1 Ensuring NFS Services are running on Ubuntu
    2. 22.2 Configuring the Ubuntu Firewall to Allow NFS Traffic
    3. 22.3 Specifying the Folders to be Shared
    4. 22.4 Accessing Shared Ubuntu Folders
    5. 22.5 Mounting an NFS Filesystem on System Startup
    6. 22.6 Unmounting an NFS Mount Point
    7. 22.7 Accessing NFS Filesystems in Cockpit
    8. 22.8 Summary
  23. 23. Sharing Files between Ubuntu and Windows Systems with Samba
    1. 23.1 Accessing Windows Resources from the GNOME Desktop
    2. 23.2 Samba and Samba Client
    3. 23.3 Installing Samba on an Ubuntu System
    4. 23.4 Configuring the Ubuntu Firewall to Enable Samba
    5. 23.5 Configuring the smb.conf File
      1. 23.5.1 Configuring the [global] Section
      2. 23.5.2 Configuring a Shared Resource
      3. 23.5.3 Removing Unnecessary Shares
    6. 23.6 Creating a Samba User
    7. 23.7 Testing the smb.conf File
    8. 23.8 Starting the Samba and NetBIOS Name Services
    9. 23.9 Accessing Samba Shares
    10. 23.10 Accessing Windows Shares from Ubuntu
    11. 23.11 Summary
  24. 24. An Overview of Virtualization Techniques
    1. 24.1 Guest Operating System Virtualization
    2. 24.2 Hypervisor Virtualization
      1. 24.2.1 Paravirtualization
      2. 24.2.2 Full Virtualization
      3. 24.2.3 Hardware Virtualization
    3. 24.3 Virtual Machine Networking
    4. 24.4 Summary
  25. 25. Installing KVM Virtualization on Ubuntu
    1. 25.1 An Overview of KVM
    2. 25.2 KVM Hardware Requirements
    3. 25.3 Preparing Ubuntu for KVM Virtualization
    4. 25.4 Verifying the KVM Installation
    5. 25.5 Summary
  26. 26. Creating KVM Virtual Machines using Cockpit and virt-manager
    1. 26.1 Installing the Cockpit Virtual Machines Module
    2. 26.2 Creating a Virtual Machine in Cockpit
    3. 26.3 Starting the Installation
    4. 26.4 Working with Storage Volumes and Storage Pools
    5. 26.5 Creating a Virtual Machine using virt-manager
    6. 26.6 Starting the Virtual Machine Manager
    7. 26.7 Configuring the KVM Virtual System
    8. 26.8 Starting the KVM Virtual Machine
    9. 26.9 Summary
  27. 27. Creating KVM Virtual Machines with virt-install and virsh
    1. 27.1 Running virt-install to build a KVM Guest System
    2. 27.2 An Example Ubuntu virt-install Command
    3. 27.3 Starting and Stopping a Virtual Machine from the Command-Line
    4. 27.4 Creating a Virtual Machine from a Configuration File
    5. 27.5 Summary
  28. 28. Creating an Ubuntu KVM Networked Bridge Interface
    1. 28.1 Identifying the Network Management System
    2. 28.2 Getting the Netplan Network Settings
    3. 28.3 Creating a Netplan Network Bridge
    4. 28.4 Getting the Current Network Manager Settings
    5. 28.5 Creating a Network Manager Bridge from the Command-Line
    6. 28.6 Declaring the KVM Bridged Network
    7. 28.7 Using a Bridge Network in a Virtual Machine
    8. 28.8 Creating a Bridge Network using nm-connection-editor
    9. 28.9 Summary
  29. 29. Managing KVM using the virsh Command-Line Tool
    1. 29.1 The virsh Shell and Command-Line
    2. 29.2 Listing Guest System Status
    3. 29.3 Starting a Guest System
    4. 29.4 Shutting Down a Guest System
    5. 29.5 Suspending and Resuming a Guest System
    6. 29.6 Saving and Restoring Guest Systems
    7. 29.7 Rebooting a Guest System
    8. 29.8 Configuring the Memory Assigned to a Guest OS
    9. 29.9 Summary
  30. 30. An Introduction to Linux Containers
    1. 30.1 Linux Containers and Kernel Sharing
    2. 30.2 Container Uses and Advantages
    3. 30.3 Ubuntu Container Tools
    4. 30.4 The Docker Registry
    5. 30.5 Container Networking
    6. 30.6 Summary
  31. 31. Working with Containers on Ubuntu
    1. 31.1 Installing the Container Tools
    2. 31.2 Pulling a Container Image
    3. 31.3 Running the Image in a Container
    4. 31.4 Managing a Container
    5. 31.5 Saving a Container to an Image
    6. 31.6 Removing an Image from Local Storage
    7. 31.7 Removing Containers
    8. 31.8 Building a Container with Buildah
    9. 31.9 Summary
  32. 32. Setting Up an Ubuntu Web Server
    1. 32.1 Requirements for Configuring an Ubuntu Web Server
    2. 32.2 Installing the Apache Web Server Packages
    3. 32.3 Configuring the Firewall
    4. 32.4 Port Forwarding
    5. 32.5 Starting the Apache Web Server
    6. 32.6 Testing the Web Server
    7. 32.7 Configuring the Apache Web Server for Your Domain
    8. 32.8 The Basics of a Secure Web Site
    9. 32.9 Configuring Apache for HTTPS
    10. 32.10 Obtaining an SSL Certificate
    11. 32.11 Summary
  33. 33. Configuring an Ubuntu Postfix Email Server
    1. 33.1 The structure of the Email System
      1. 33.1.1 Mail User Agent
      2. 33.1.2 Mail Transfer Agent
      3. 33.1.3 Mail Delivery Agent
      4. 33.1.4 SMTP
      5. 33.1.5 SMTP Relay
    2. 33.2 Configuring an Ubuntu Email Server
    3. 33.3 Postfix Pre-Installation Steps
    4. 33.4 Firewall/Router Configuration
    5. 33.5 Installing Postfix on Ubuntu
    6. 33.6 Configuring Postfix
    7. 33.7 Configuring DNS MX Records
    8. 33.8 Starting Postfix on an Ubuntu System
    9. 33.9 Testing Postfix
    10. 33.10 Sending Mail via an SMTP Relay Server
    11. 33.11 Summary
  34. 34. Adding a New Disk Drive to an Ubuntu System
    1. 34.1 Mounted File Systems or Logical Volumes
    2. 34.2 Finding the New Hard Drive
    3. 34.3 Creating Linux Partitions
    4. 34.4 Creating a File System on a Disk Partition
    5. 34.5 An Overview of Journaled File Systems
    6. 34.6 Mounting a File System
    7. 34.7 Configuring Ubuntu to Automatically Mount a File System
    8. 34.8 Adding a Disk Using Cockpit
    9. 34.9 Summary
  35. 35. Adding a New Disk to an Ubuntu Volume Group and Logical Volume
    1. 35.1 An Overview of Logical Volume Management (LVM)
      1. 35.1.1 Volume Group (VG)
      2. 35.1.2 Physical Volume (PV)
      3. 35.1.3 Logical Volume (LV)
      4. 35.1.4 Physical Extent (PE)
      5. 35.1.5 Logical Extent (LE)
    2. 35.2 Getting Information about Logical Volumes
    3. 35.3 Adding Additional Space to a Volume Group from the Command-Line
    4. 35.4 Summary
  36. 36. Adding and Managing Ubuntu Swap Space
    1. 36.1 What is Swap Space?
    2. 36.2 Recommended Swap Space for Ubuntu
    3. 36.3 Identifying Current Swap Space Usage
    4. 36.4 Adding a Swap File to an Ubuntu System
    5. 36.5 Adding Swap as a Partition
    6. 36.6 Adding Space to an Ubuntu LVM Swap Volume
    7. 36.7 Adding Swap Space to the Volume Group
    8. 36.8 Summary
  37. 37. Ubuntu System and Process Monitoring
    1. 37.1 Managing Processes
    2. 37.2 Real-time System Monitoring with htop
    3. 37.3 Command-Line Disk and Swap Space Monitoring
    4. 37.4 Summary
  38. Index

Product information

  • Title: Ubuntu 20.04 Essentials
  • Author(s): Neil Smyth
  • Release date: August 2020
  • Publisher(s): Packt Publishing
  • ISBN: 9781800568525