The Linux operating system is a popular option for both desktop and server environments. In this video, you’ll learn about Linux, the Linux bootloader, the Linux kernel, systemd, and important Linux configuration files.
Linux is a free operating system that has a similar style and operation to the older Unix operating system. Linux is an operating system that has many different types. We refer to these different types as Linux distributions. For example, you might see some Linux distributions called Ubuntu, another one called Debian, another one with Red Hat, and others.
One of the big advantages of the Linux operating system is that there’s no cost to be able to install and use this operating system. And Linux runs on a number of different hardware platforms. You can run Linux on a brand-new computer, or you can go back a number of years and run Linux on those older pieces of hardware. Linux has the flexibility to support a lot of different types of hardware. And there is a very passionate and very active user community that helps support Linux on the internet.
There’s obviously no one central company that manages Linux as an operating system, so we do rely on that user community for updates to the operating system and additional device drivers. This means you could get a brand-new computer with a new video card, and you may find that there’s no Linux device driver to be able to use that video card.
Using Linux is very similar to almost any other operating system. We’ve become very accustomed to having a desktop with icons, being able to choose applications from a list or a dock, and this is very similar to the operation you might find in Windows or Mac OS.
When you turn on your computer, it goes through a process to be able to start the operating system that you’ve configured on the storage drive of that computer. This means we could be running Windows, Linux, macOS, or other operating systems on this computer. But how does the computer know how to load that operating system?
The first thing that starts when you power on a computer is the Basic Input/Output System, or the BIOS. The BIOS is configured with a list of all of the storage devices connected to your system, and one of those storage devices is configured to be the bootable storage device.
The BIOS then turns over the boot process to that storage device that has been marked as the boot device. That boot device then runs a bootloader that’s usually located in the boot sector of that boot device. It’s that bootloader that is responsible for then starting up the operating system that’s been installed on that storage device.
If you go into the BIOS configuration of your device, there’s usually a section that describes the startup sequence. This tells the BIOS the order that should be used to try booting an operating system from these devices. From this list, you can specify USB drives, optical drives, SSDs, hard drives, and any other storage device that may be connected to your computer. The one that’s at the top of the list will be tried first, the one that’s second on the list will be tried second, and so on.
The type of BIOS on our modern computers is a UEFI BIOS. This stands for the Unified Extensible Firmware Interface. This BIOS has the configuration we mentioned earlier that tells it to go to a storage drive and begin starting the operating system. On that storage device is an EFI System Partition, or ESP. And in that partition, we have a list of all of the EFI files that are associated with different operating systems on that storage drive.
For example, there might be a load-a EFI that is configured to start one OS kernel and a load-b EFI that’s configured to start another OS kernel. You’re usually presented on the screen with an option of which operating system you’d like to start. You select the one that you would like to begin, and the correct OS kernel will start based on the EFI files.
This kernel is the core of the operating system that you’ll be launching. It is the software that manages everything else that happens inside of that operating system. The kernel starts the system, it loads up any device drivers, it manages applications that are executing, it makes sure that system processes are running, and it interacts with you, the end user.
This kernel manages the most important aspects of your operating system. When you’re starting your system, it manages system processes, and it interacts with devices and other pieces of hardware that are connected to your computer.
Because this kernel is so important, it has its own area of memory that it runs in. We refer to this as kernel space. This is different than the applications that you’re running on your computer, which are running in user space. And you will see times where you need to upgrade the kernel of your operating system, probably because there are new features, bug fixes, security patches, and other important changes.
If you’re familiar with Windows, then when you start the Windows operating system. There are a series of services that load in the background of the operating system. There’s a similar process in Linux, and the software that manages that process is systemd. These background processes or services that are running in Linux are referred to as daemons, and systemd is responsible for starting, stopping, and managing those daemons.
For example, when you start up your Linux operating system, there needs to be a logging process that begins, and systemd starts that process. The kernel of your Linux operating system is responsible for starting systemd. systemd then starts the process is necessary to get your system running. And finally, we have Linux up and running. systemd is a relatively new addition to the Linux operating system, and it was created so that we could have one consistent set of tools to be able to start our system and manage all of these background daemons.
In the Windows operating system, if you want to log in and have full control over the entire operating system, you log in as the administrator user. In Linux, you log in as the root user. The root user has full control of the Linux operating system, and you can start and manage all applications by using the root user. This means if you need to make changes to system files, you need to install a new daemon, or do anything else from an administrative nature, you’ll probably need to do this with root permissions.
If you use Windows or macOS, then you’re aware that the graphical user interface is an important part of those operating systems. But in Linux, the user interface is an optional piece of the OS. You can run Linux completely from the command line, and be able to control and manage any aspect of the operating system. Most aspects of the Linux operating system are managed from text-based configuration files, and if you need to make a change to the operating system, it’s as simple as editing one of those text files.
When you add a user to a Linux system, a number of important parameters associated with that user are stored in a file in the /etc directory, and the file name that it stores it is passwd. This lists all of the users on the system, along with a number of configuration parameters, such as the username, password information, user ID, group ID, user ID information, home directory, and the command or shell that you’d like to run as that user.
The first item on each of these lines is the username. And you’ll notice there are system usernames at the top of this, and then we have some users that are listed down near the bottom. There’s Professor and Jack and Sam and other users. You’ll notice that the second item on each line is the letter x. That’s where the password would normally go. And if you look at your Linux distribution, you’ll notice that your password file has x’s in it as well, where the password would normally be.
We realize that having a single file that’s able to be read by everyone that has usernames and a hashed version of the password leaves our system susceptible to a brute force attack. So we took the passwords out of the password file and put them into a different file, known as the shadow file. This is also located in the /etc directory, and you’ll notice it has the same list of names associated with it. But now, we have a list of hashed passwords along with the username.
The difference with the shadow file is that it is a protected file that cannot be viewed by other people on the system unless they have elevated rights and permissions. This file format is very similar to the one you just saw with the password file. It has a list of the usernames, it has a password hash, the date of the last password change, and other parameters.
It’s obviously important that this file is protected, because we don’t want that password hash to get in the hands of an attacker, where they can reverse engineer or brute force the password based on the hash that is stored in the shadow file.
Another important file in your Linux distribution is also in the /etc directory, and the name of that file is hosts. This is a file that associates a Fully Qualified Domain Name, or an FQDN, with an IP address. For example, it might have an IP address of 10.1.10.224, and it has a fully qualified domain name associated with that IP address of staging.professormesser.com.
Before there was a Domain Name System, or a DNS, this host file was how we provided a resolution between a name and an IP. Obviously, adding single lines to a host file does not scale very well, which is why we decided DNS would be a better choice going forward. But this host file still exists on these systems, and it does still have an important use. If you want to override the settings associated with DNS, you can add the IP address and fully qualified domain name to the host file, and anything in the host file takes priority over the DNS settings.
Well, if we aren’t going to use the host file and we’re going to use DNS, how do we tell Linux where these DNS servers are? To do that, we use another file that’s in your /etc directory called resolv.conf. This file contains a list of DNS servers that this Linux machine will use for name resolution. You can look at the resolv.conf file to see what name servers have been configured.
For example, on this device, nameserver 127.0.0.53 is the only name server listed in the resolv.conf file. If you’re troubleshooting a GNS configuration or you want to confirm the DNS settings on a Linux machine, then you should look at the /etc directory in the resolv.conf file.
Connected to your Linux device are storage devices that have partitions and other file systems. This means that we need to tell our Linux operating system where these partitions are, and what type of file system is on those partitions. We do this using another file that’s in your /etc directory called fstab for File System Table.
When your system starts up, it references this file system table to be able to mount all of the different drives that you’re using for this Linux operating system. And if you start your Linux distribution and you find that a particular file or drive is missing, it may not be listed in your fstab file.
