Setting Up A Red Hat Enterprise Linux Server
Setting Up A Red Hat Enterprise Linux Server
Welcome
Did you know that Linux was developed by a 21 year old college student as part of a
hobby? Fast forward a couple of decades, and here we are. Linux comes in hundreds of
versions, and it's widely used. I'm Sandy Toner, and much like that college student in
Helsinki, I’m a Linux enthusiast. I'm excited to share with you the knowledge and
skills necessary to manage a Red Hat Enterprise Linux server. In this course, we'll cover
installing GNU/Linux, working and configuring the operating system, and managing
system administration.
Working through this course will give you exposure to both the graphical interface, as
well as the command line interface. We'll explore system tools and utilities that support
efficient management of the system. Since the course will focus on Red Hat Enterprise
Linux version 7,there's something new for everyone, even if you've used Linux
before. Get ready to join the global movement to Linux. Set your brain standard input to
this course, and let's get started.
Finding help
In this video, we'll practice some different ways to find help at the command line.Bash
allows users to run hundreds of commands, so it's practically impossible to know every
command and all the different ways each command can be used. One way to get help is
to use the help option. From the shell prompt, you can type the command, followed by
dash help, to see a summary of that command. Let's try this with the Wget
command. Wget is a command line utility that downloads files over a network. First, we'll
type the command, then we'll add a dash h or dash help option, and hit enter.
You can see that the help pages are pretty extensive. Let's try this again. This time we'll
do the same thing, we'll run the help option on the Wget command, but we'll take the
output of that and we'll pipe it over to a less command so we can see the output in an
easier to read, page by page format. To do this, we'll run the same command that we
just ran. Instead of typing it out, I can just hit the arrow key, upward. Now we'll want to
add a pipe. On some keyboards, the pipe will appear as a broken pipe.
It'll still complete the same function. Next we're going to want to add the L-E-S-S, or less
command. Now hit enter. You can see that this is a lot easier to read. To exit out of this
output, hit Q. Now you're back at the command prompt. Let's look at another way to get
information about command usage. We can use something called the man pages. Even
the most veteran Red Hat Enterprise Linux sysadmin will still use the valuable
command manual page. The most useful sections of the man page are Section 1, that
has commands, Section 5, that has file formats and convention, and Section 8, that has
sysadmin commands.
Let's say you know what you're looking for. You want to find the manual page on the
man command. We'll start with the man command, and we'll also use the man
command as the argument. When you hit enter, it'll open up the manual page for the
man command. To exit out, hit Q. That'll take you back to your command prompt. Let's
say that you want to search the man pages by keyword, because you're not really
sure what command you're looking for. To do this, you can type the man command, add
a dash k argument for keyword, and then write the word.
The output will show you all the man pages that include the keyword help. In the next
chapter we'll start exploring user and group management.
Managing logs
In this chapter, we'll locate system log files. Log files can be useful when trying to
troubleshoot a problem with the system. Like looking for unauthorized login
attempts. Now I'll show you where to find the system log files. By default, there's two
login tools that coexist on your system. Some log files are controlled by a daemon
called rsyslogd. We worked with this, rsyslogd in a previous video in this course. Log
files can also be managed by the journald daemon, it's a system component.
The journald is a component of systemd, which is responsible for viewing and
management of log files. Journald is closely integrated with the rest of the system. It
supports not only various login technologies, but also acts as management for the log
files. To access the journal logs, use the command journalctl and hit Enter. I can scroll
through the logs by using the downward arrow. So I scroll through the log results
here and I want to highlight one result for you. You can see that on August 18th, about
half way down the page, you can see a log entry that indicates the Network Manager
was started.
The output of this command, is a pretty long list of log files. This includes messages
generated by system components and by users. Let's use the dash n option to
reduce the journalctl output to a number of entries. I typed q to return to the command
prompt. Now, let's re-run the same command, but this time, we'll give it a dash n
option. Keep in mind, that when no number is specified, it'll actually just give you the last
ten most recent entries.
You can see this is a little easier to read. And if you know that you're looking for
something in the log file that just happened, then you shouldn't need to really go
through all of those log entries. In the next video, we'll talk about the Red Hat Enterprise
Linux Package Manager and look at managing software.
Managing software
In this video we'll talk about the Red Hat Enterprise Linux package manager. An RPM
file also known as a package is a way of distributing software so that it can be easily
installed updated and deleted. RPM files have information about the package name, the
version and other dependency information. Yum is the most used sysadmin tool for
managing software packages from the official Red Hat software repositories, sometimes
referred to as Repos. You can also get third party repositories using yum but you'll need
to have some of the vendor information and you'll have to have set up a local repo.
A systems administrator will regularly use the yum command to install security
updates and binary packages. You need to log in as root to use the yum command. One
way that you can check if there's any pending updates is to use the command yum
space check dash update and hit enter. It doesn't look like we have any current
updates but we'll go ahead and run an update to see what happens. If you want to
update all packages and their dependencies you use yum space update without any
arguments.
In the results we received a message that says no packages marked for update. Now if
you want to update a single package you'll use the same command, yum space
update but as the argument you'll use the package name. Keep in mind that you're
going to have to run the yum command as root. So like I've said before, a Red Hat
Enterprise Linux system needs to be subscribed to the Red Hat content delivery
network. When a system is subscribed and connected a repository file is created in
the Etc yum dot repos dot d directory.
Let's switch over to that directory and and see what we can find inside. First, we'll need
to change directories. To do that we'll issue a cd command and we'll need to use our
target destination as the argument. Slash etc slash yum dot repos dot d and go ahead
and hit enter. Now you can see the command prompt changed so we know we're in the
right place. Now in order to see what's in this directory we'll use the ls command. The
results show us that we have a Red Hat dot repo.
Another way to look at the available repos is to list all of your enabled repositories. Now
that we've seen the contents of the directory, I'll go ahead and switch directories
back. First we need to download and install the epel repo. To do that we'll use the wget
command. Wget stands for web get. It's a command line utility that downloads files over
a network. For the argument we need the download link. I'm going to type in the link for
epel at the Padora Project.
When you've entered in the web address go ahead and hit enter. Now that we've got it
downloaded we'll need to install it. You can do this with the rpm command. With the
options dash IVH we'll install the package. Now we need the package name. When
you've entered the package name hit enter. Now to make sure you've downloaded and
installed the repo, let's use yum again to list all enabled repositories. To do that we'll
use the yum command followed by repo list.
Here you can see that in addition to the Red Hat Enterprise Linux 7 server
package we've also got the extra packages for Enterprise Linux 7. A valuable trick for
a Red Hat Enterprise Linux administrator is to be able to display packages not
installed via the official Red Hat network subscription repos. If you want to see all
packages not available via subscribed channels or repositories type yum space list
space extras and hit enter. We didn't receive any results which means that all of our
repos were installed with the official Red Hat network subscription repos.
Now if you want some help you can access a great yum command cheat sheet at the
Red Hat customer portal. In the next video we'll talk about managing the boot process.