
Using and Administering Linux – Zero to SysAdmin: 2nd Edition
This Linux training course, “Using and Administering Linux – Zero to SysAdmin,” is significantly different from other courses. It consists of three volumes. Each of these three volumes is closely connected and they build upon each other.
This Linux training course differs from others because it is a complete self-study course. You should start at the beginning of Volume 1 and read the text, perform all of the experiments, and do all of the chapter exercises through to the end of Volume 3. If you do this, even if you are starting from zero knowledge about Linux, you can learn the tasks necessary to becoming a Linux system administrator, a SysAdmin.
Another difference this course has over others is that all of the experiments are performed on one or more virtual machines (VMs) in a virtual network. Using the free software, VirtualBox, you will create this virtual environment on any reasonably sized host, whether Linux or Windows. In this virtual environment you are free to experiment on your own, make mistakes that could damage the Linux installation of a hardware host, and still be able to recover completely by restoring the Linux VM host from any one of multiple snapshots. This flexibility to take risks and yet recover easily makes it possible to learn more than would otherwise be possible.
These course materials can also be used as reference materials. I have used my previous course materials for reference for many years and they have been very useful in that role. I have kept this as one of my goals in this set of materials.
Not all of the review exercises in this course can be answered by simply reviewing the chapter content. For some questions you will need to design your own experiment in order to find a solution. In many cases there will very probably be multiple solutions and all that produce the correct results will be the “correct” ones.
My Process
The process I use with this format is just as important as the format of the course – really even more so. The first thing that a course developer must do is generate a list of requirements that define both the structure and the content of the course. Only then can the process of writing the course proceed. In fact, many times I find it helpful to write the review questions and exercises before I create the rest of the content. In many chapters of this course I have worked in this manner.
These courses present a complete, end to end Linux training course for students like you who know before you start that you want to learn to be a Linux system administrator – a SysAdmin. This Linux course will allow you to learn Linux right from the beginning with the objective of becoming a SysAdmin.
Many Linux training courses begin with the assumption that the first course a student should take is one designed to start them as users. Those courses may discuss the role of root in system administration, but ignore topics that are important to future SysAdmins. Other courses ignore system administration altogether. A typical second course will introduce the student to system administration, while a third may tackle advanced administration topics.
Frankly, this baby step approach didn’t work well for many of us who are now Linux SysAdmins. We became SysAdmins, in part at least, due to our intense desire to learn as much as possible as quickly as possible. It is also, I think in large part, due to our highly inquisitive natures. We learn a basic command and then start asking questions, experimenting with it to see what its limits are, what breaks it, what using it can break. We explore the man(ual) pages and other documentation to learn the extreme usages to which it might be put. If things don’t break by themselves, we break them intentionally to see how they work and to learn how to fix them. We relish our own failures because we learn more from fixing them than we do when things always work as they are supposed to.
In this course we will dive deep into Linux system administration almost from the very beginning. You will learn many of the Linux tools required to use and administer Linux workstations and servers – usually multiple tools that can be applied to each of these tasks. This course contains many experiments to provide you with the kind of hands-on experiences that SysAdmins appreciate. All of these experiments guide you one step at a time into the elegant and beautiful depths of the Linux experience. You will learn that Linux is simple and that simplicity is what makes it both elegant and knowable.
Based on my own years working with Unix and Linux, the course materials contained in these three volumes are designed to introduce you to the practical, daily tasks you will perform as a Linux user and, at the same time, as a Linux system administrator – SysAdmin.
But I don’t know everything – that’s just not possible – no SysAdmin does. Further, no two SysAdmins know exactly the same things because that too is impossible. We have each started with different knowledge and skills; we have different goals; we have different experiences because the systems on which we work have failed in different ways, had different hardware, were embedded in different networks, had different distributions installed, and many other differences. We use different tools and approaches to problem solving because the many different mentors and teachers we had used different sets of tools from each other; we use different Linux distributions; we think differently; and we know different things about the hardware on which Linux runs. Our past is much of what makes us what we are and what defines us as SysAdmins.
So I will show you things in this course – things that I think are important for you to know – things that, in my opinion, will provide you with the skills to use your own curiosity and creativity to find solutions that I would never think of to problems I have never encountered.
I have always found that I learn more from my mistakes than I ever have when things work as they are supposed to. For this reason I suggest that, rather than immediately reverting to an earlier snapshot when you run into trouble, you try to figure out how the problem was created and how best to recover from it. If, after a reasonable period of time, you have not resolved the problem, that would be the point at which reverting to a snapshot would make sense.
What this course is not
This course is not a certification study guide. It is not designed to help you pass a certification test of any type. This course is intended purely to help you become a good or perhaps even great SysAdmin, not to pass a test.
There are a few good certification tests. Red Hat and Cisco certifications are among the best because they are based on the test-taker’s ability to perform specific tasks. I am not familiar with any of the other certification tests because I have not taken them. But the courses you can take and books you can purchase to help you pass those tests are designed to help you pass the tests and not to administer a Linux host or network. That does not make them bad – just different from this course.
Content overview
This quick overview of the contents of each volume should serve as a quick orientation guide if you need to locate specific information. If you are trying to decide whether to purchase this book and its companion volumes, it will give you a good overview of the entire course.
Using and Administering Linux: Volume 1 – Zero to SysAdmin: Getting Started
Chapters 1 through 3 of Volume 1 introduces operating systems in general and Linux in particular. briefly explore the The Linux Philosophy for SysAdmins1 in preparation for the rest of the course.
Chapter 4 then guides you through the use of VirtualBox to create a virtual machine (VM) and a virtual network to use as a test laboratory for performing the many experiments that are used throughout the course. In Chapter 5, you will install the Xfce version of Fedora – a popular and powerful Linux distribution – on the VM. Chapter 6 shows you how to use the Xfce desktop which will enable you to leverage your growing command-line interface (CLI) expertise as you proceed through the course.
Chapters 7 and 8 will get you started using the Linux command line and introduce you to some of the basic Linux commands and their capabilities. In Chapter 9 you will learn about data streams and the Linux tools used to manipulate them. And in Chapter 10 you will learn a bit about several text editors which are indispensable to advanced Linux users and system administrators. You will also learn to use the Vim text editor to create and modify the many ASCII plain text files that Linux uses for configuration and administrative programming.
Chapter 11 through 13 start your work as a SysAdmin and take you through some specific tasks such as working as root, and installing software updates and new software. Chapters 14 and 15 discuss more terminal emulators and some advanced shell skills. In Chapter 16 you will learn about the sequence of events that take place as the computer boots and Linux starts up. Chapter 17 shows you how to configure your shell to personalize it in ways that can seriously enhance your command line efficiency.
Finally, Chapter 18 and 19 dive into all things file and filesystems.
- Introduction
- Introduction to Operating Systems
- The Linux Philosophy for SysAdmins
- Preparation
- Installing Linux
- Using the Xfce Desktop
- Using the Linux Command Line
- Linux core utilities
- Data Streams
- Text Editors
- Working as Root
- Installing and Updating New Software
- Tools For Problem Solving
- Terminal Emulator Mania
- Shell Configuration
- Files, Directories, and Links
- Linux Boot and Startup
- Shell Configuration
- Filesystems
Using and Administering Linux: Volume 2 – Zero to SysAdmin: Advanced Topics
Volume 2 of Using and Administering Linux introduces you to some incredibly powerful and useful advanced topics that every SysAdmin must know.
In Chapters 20 and 21 you will experience an in-depth exploration of logical volume management – and what that even means – as well as the use of file managers to manipulate files and directories. Chapter 22 introduces the concept that, in Linux, everything is a file. You will also learn some fun and interesting uses of the fact that everything is a file.
In Chapter 23 you will learn to use several tools that enable the SysAdmin to manage and monitor running processes. Chapter 24 enables you to experience the power of the special filesystems, such as /proc, which enable us as SysAdmins to monitor and tune the kernel while it is running – without a reboot.
Chapter 25 will introduce you to regular expressions and the power that using them for pattern matching can bring to the command line, while Chapter 26 discusses managing printers and printing from the command line. In Chapter 27 you will use several tools to unlock the secrets of the hardware in which your Linux operating system is running.
Chapters 28 and 29 show you how to do some simple – and not so simple – command line programming and how to automate various administrative tasks. In Chapter 30 you will learn to use Ansible, a powerful tool that makes automating tasks for thousands of computers just as easy as for one. Chapter 31 discusses the tools you will use to perform repetitive and automated tasks at specific times.
You will begin to learn the details of networking in Chapter 32, and Chapter 33 covers use of the powerful NetworkManager tool.
Chapter 34 introduces the BTRFS file system and covers its very interesting features. This chapter also informs you why BTRFS is not an appropriate choice for a filesystem in most use cases.
Chapters 35 through 37 allow you to explore systemd, the modern tool for starting Linux at boot time and which is also used to manage system services and tools.Chapter 38 discusses Dbus and UDEV and how Linux uses them to treat all devices as plug and play.
Chapter 40 covers the tasks required to manage users while Chapter 41 introduces you to some basic tasks needed to manage the firewall. You will use the firewalld command line tool to create and manage zones to which the network interfaces will be assigned based on various security needs such as internal and external networks.
- Logical Volume Management
- File Managers
- Everything is a File
- Managing Processes
- Special Filesystems
- Regular Expressions
- Printing
- Hardware Detection
- Command Line Programming
- Automation with Bash Scripts
- Automation with Ansible
- Time and Automation
- Networking
- NetworkManager
- The BTRFS filesystem
- systemd – getting started
- Advanced systemd functions
- systemd Finale
- Dbus and Udev
- Traditional Logs
- Managing Users
- Managing the Firewall
Using and Administering Linux: Volume 3 – Zero to SysAdmin: Network Services
In Volume 3 of Using and Administering Linux you will start by creating a new VM on the existing virtual network. This new VM will be used as a server for the rest of this course and it will replace some of the functions performed by the virtual router that is part of our virtual network.
Chapter 42 begins this transformation from simple workstation to server by adding a second network interface card (NIC) to the new VM so that it can act as a firewall and router, then changing its network configuration from DHCP to static IP addressing. This includes configuring both NICs so that one is connected to the existing virtual router so as to allow connections to the outside world, and so that the other NIC connects to the new “inside” network that will contain the existing VM.
Chapter 43 Discusses Name Services (DNS) in detail both from client and server standpoints. You’ll learn to use the /etc/hosts file for simple name resolution, then create a simple caching name server. You will then convert the caching name server into a primary name server for your internal network.
In Chapter 44 you will convert the new server into a router using kernel parameters and a simple firewall configuration change.
Chapter 45 shows how to use SSHD to provide secure remote access between Linux hosts. It also provides some interesting insights into using commands remotely and creating a simple command line program to back up specific directories of a remote host to the local host.
Although we have incorporated security in all aspects of what has already been covered, Chapter 46 covers some additional security topics. This includes physical hardening as well as further hardening of the host to provide enhanced protection from network intrusions.
In chapter 47 you will techniques and strategies for creating backups that use easily available open source tools and which are easy to use for both creating backups and restoring complete filesystems or individual files.
You will learn to install and configure an enterprise class email server that can detect and block most spam and malware in Chapters 47 through 50. Chapter 51 takes you through setting up a web server and in Chapter 52 you will set up WordPress, a flexible and powerful content management system.
In Chapter 53 you return to email by setting up a mailing list using MailMan.
Sometimes accessing a desktop remotely is the only way to do some things so in Chapter 54 you will do just that.
Chapter 55 discusses package management from the other direction by guiding you through the process of creating an RPM package for the distribution of your own scripts and configuration files. Then Chapter 56 guides you through sharing files to both Linux and Windows hosts.
Finally, Chapter 57 will get you started in the right direction because I know you are going to ask, “Where do I go from here?”
- ServerPreparation
- Name Services
- Routing and Firewalls
- Remote Access with SSH
- Security
- Backup everything –Frequently
- Introducing Email
- Email Clients
- Combating Spam
- Apache Web Server
- WordPress
- Mailing Lists
- Remote Desktop Access
- Advanced Package Management
- File Sharing with NFS and Samba
- Where Do I Go From Here?
Taking this course
Although designed primarily as a self-study guide, this course can be used effectively in a classroom environment. This course can also be used very effectively as a reference. Many of the original course materials I wrote for Linux training classes I used to teach as an independent trainer and consultant were valuable to me as references. The experiments became models for performing many tasks and later became the basis for automating many of those same tasks. I have used many of those original experiments in parts of this course, because they are still relevant and provide an excellent reference for many of the tasks I still need to do.
You will see as you proceed through the course that it uses many software programs considered to be older and perhaps obsolete like Sendmail, Procmail, BIND, the Apache web server, and much more. Despite their age, or perhaps because of it, the software I have chosen to run my own systems and servers and to use in this course has been well-proven and is all still in widespread use. I believe that the software we will use in these experiments has properties that make it especially valuable in learning the in-depth details of how Linux and those services work. Once you have learned those details, moving to any other software that performs the same tasks will be relatively easy. In any event, none of that “older” software is anywhere near as difficult or obscure as some people seem to think that it is.
Who should take this course
If you want to learn to be an advanced Linux user and even a SysAdmin, this course is for you. Most SysAdmins have an extremely high level of curiosity and a deep seated need to learn Linux system administration. We like to take things apart and put them back together again to learn how they work. We enjoy fixing things and are not hesitant about diving in to fix the computer problems that our friends and co-workers bring us.
We want to know what happens when some computer hardware fails so we might save defective components such as motherboards, RAM memory, and storage devices. This gives us defective components with which we can run tests. As I write this, I have a known defective hard drive inserted in a hard drive docking station connected to my primary workstation, and have been using it to test failure scenarios that will appear in this course.
Most importantly, we do all of this for fun and would continue to do so even if we had no compelling vocational reason for doing so. Our intense curiosity about computer hardware and Linux leads us to collect computers and software like others collect stamps or antiques. Computers are our avocation – our hobby. Some people like boats, sports, travel, coins, stamps, trains, or any of thousands of other things, and they pursue them relentlessly as a hobby. For us – the true SysAdmins – that is what our computers are. That does not mean we are not well-rounded and don’t do other things. I like to travel, read, go to museums and concerts, ride historical trains, and my stamp collection is still there, waiting for me when I decide to take it up again.
In fact, the best SysAdmins, at least the ones I know, are all multifaceted. We are involved in many different things and I think that is due to our inexhaustible curiosity about pretty much everything. So if you have an insatiable curiosity about Linux and want to learn about it – regardless of your past experience or lack thereof – then this course is most definitely for you.
Who should not take this course
If you do not have a strong desire to learn about how to use or administer Linux systems, this course is not for you. If all you want – or need – to do is use a couple apps on a Linux computer that someone has put on your desk, this course is not for you. If you have no curiosity about what superpowers lie behind the GUI desktop, this course is not for you.
Why this course
Someone asked me why I wanted to write this course. My answer is simple – I want to give back to the Linux community. I have had several amazing mentors over the span of my career and they taught me many things – things I find worth sharing with you along with much that I have learned for myself.
This course – all three volumes of it – started its existence as the slide presentations and lab projects for three Linux courses I created and taught. For a number of reasons I do not teach those classes any more. However I would still like to pass on my knowledge and as many of the tips and tricks I have learned for the administration of Linux as possible. I hope that with this course I can pass on at least some of the guidance and mentoring that I was fortunate enough to have in my own career.
About Fedora releases
The 1st Edition of this self-study course was originally written for Fedora 29 and we are now up to Fedora 38. As I have worked through the 2nd Edition of this course I have added new materials I thought appropriate and incorporated as many errata corrections as possible.
Where it was necessary, I have also included revised graphics such as screen shots used for illustrative purposes. In many cases the graphics for earlier releases of Fedora are still applicable although the background images and some non-essential visual elements have changed. In those cases I have retained the original graphics.
I have only replaced older graphics with newer ones where necessary to ensure the accuracy and clarity of the illustrated points. Some of the illustrations in this course are from Fedora 29. If you are using later releases of Fedora, such as Fedora 37, 38, or later, the background and other cosmetic elements may be different from Fedora 29.