Table of Contents
Mastering Ubuntu Server
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the color images of this book
Errata
Piracy
Questions
1. Deploying Ubuntu Server
Setting up our lab
Determining your server's role
Obtaining Ubuntu Server
Deciding between 32-bit and 64-bit installations
Creating a bootable Ubuntu Server flash drive (Windows)
Creating a bootable Ubuntu Server flash drive (Linux)
Creating a bootable Ubuntu Server flash drive (Mac)
Planning the partition layout
Installing Ubuntu Server
Installing Ubuntu Server (Raspberry Pi)
Summary
2. Managing Users
Understanding when to use root
Creating and removing users
Understanding the /etc/passwd and /etc/shadow files
Distributing default configuration files with /etc/skel
Switching between users
Managing groups
Managing passwords and password policies
Configuring administrator access with sudo
Setting permissions on files and directories
Summary
3. Managing Storage Volumes
Viewing disk usage
Adding additional storage volumes
Partitioning and formatting volumes
Mounting and unmounting storage volumes
Understanding the /etc/fstab file
Managing swap
Utilizing LVM volumes
Using symbolic and hard links
Summary
4. Connecting to Networks
Setting the hostname
Managing network interfaces
Assigning static IP addresses
Understanding Linux name resolution
Understanding Network Manager
Getting started with OpenSSH
Getting started with SSH key management
Simplifying SSH connections with a ~/.ssh/config file
Summary
5. Managing Software Packages
Understanding Linux package management
Installing and removing software
Searching for packages
Managing software repositories
Keeping your server up to date
Backing up and restoring packages
Making use of aptitude
Installing Snap packages
Summary
6. Controlling and Monitoring Processes
Showing running processes with the ps command
Managing jobs
Killing misbehaving processes
Utilizing htop
Managing system processes
Monitoring memory usage
Scheduling tasks with Cron
Understanding load average
Summary
7. Managing Your Ubuntu Server Network
Planning your IP address scheme
Serving IP addresses with isc-dhcp-server
Setting up name resolution (DNS) with bind
Creating a secondary DNS server
Setting up an Internet gateway
Keeping your system clock in sync with NTP
Summary
8. Accessing and Sharing Files
File server considerations
Sharing files with Windows users using Samba
Setting up NFS shares
Transferring files with rsync
Transferring files with SCP
Mounting remote filesystems with SSHFS
Summary
9. Managing Databases
Preparations for setting up a database server
Installing MariaDB
Taking a look at MariaDB configuration
Understanding how MariaDB differs in Ubuntu 16.04
Managing databases
Setting up a slave DB server
Summary
10. Serving Web Content
Installing and configuring Apache
Installing additional Apache modules
Securing Apache with SSL
Setting up high availability with keepalived
Installing and configuring ownCloud
Summary
11. Virtualizing Hosts and Applications
Setting up a virtual machine server
Creating virtual machines
Bridging the virtual machine network
Creating, running, and managing Docker containers
Summary
12. Securing Your Server
Lowering your attack surface
Securing OpenSSH
Installing and configuring Fail2ban
MariaDB best practices
Setting up a firewall
Encrypting and decrypting disks with LUKS
Locking down sudo
Summary
13. Troubleshooting Ubuntu Servers
Evaluating the problem space
Conducting a root-cause analysis
Viewing system logs
Tracing network issues
Troubleshooting resource issues
Diagnosing defective RAM
Summary
14. Preventing and Recovering from Disasters
Preventing disasters
Utilizing Git for configuration management
Implementing a backup plan
Creating system images with Clonezilla live
Utilizing bootable recovery media
Summary
Index
Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: July 2016
Production reference: 1210716
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-452-6
www.packtpub.com
Author
Jay LaCroix
Reviewers
David Diperna
Robert Stolk
Acquisition Editor
Prachi Bisht
Content Development Editor
Trusha Shriyan
Technical Editor
Vishal K. Mewada
Copy Editor
Madhusudan Uchil
Project Coordinator
Kinjal Bari
Proofreader
Safis Editing
Indexer
Hemangini Bari
Graphics
Kirk D'Penha
Production Coordinator
Shantanu N. Zagade
Cover Work
Shantanu N. Zagade
Jay LaCroix is an open-source enthusiast, specializing in Linux. He is passionate about Linux and its long-term adoption, and has been using Linux since 2002. Jay currently works as a DevOps Engineer for SolvIT Inc, and he holds a masters degree in Information Systems Technology Management from Capella University. During the course of his studies, he's obtained several certifications, including Linux+, LPIC-2, and SUSE Certified Linux Professional, among others. In addition to a great career working with Linux technologies, Jay also has a YouTube channel, available at LearnLinux.tv
, where he posts instructional tutorial videos demonstrating how to utilize Linux and open-source technologies. When not practicing with technology, Jay enjoys photography, music, classic video-games and writing. He has also written Linux Mint Essentials and Mastering Linux Network Administration, also published by Packt Publishing.
First and foremost, I would like to thank Randy Schapel at Mott Community College for conducting a Linux class back in 2002 that was responsible for creating a life-long addiction for me. During a time where Linux wasn't nearly as popular as it is today, that class spring-boarded my career and passion. In addition, I would also like to thank Packt Publishing for the wonderful opportunity I've been given, to share my knowledge with others. I never would've thought I'd be a published author, but here I am. It's hard to believe, but this is my third book, and writing it has been an incredibly enjoyable experience. I would like to thank Prachi Bisht for the opportunity of writing this book in particular, and Trusha Shriyan for supporting me as it was being written. In addition, I would also like to thank James Jones for introducing me to writing for Packt in the first place, back in 2014. I would also like to thank everyone else I've worked with at Packt, who have all been very supportive.
I would like to thank my best friend Krys for being there for me, Jim for his help and support, my two sons Alan and Johnny for being great kids, and my family on the Sherman side for not only being amazing, but also very supportive. I would like to thank the team at Security Inspection for being an amazing group of people to work with.
Last but certainly no...