Learn CentOS Linux Network Services Vazquez instant download
Learn CentOS Linux Network Services Vazquez instant download
download
https://textbookfull.com/product/learn-centos-linux-network-
services-vazquez/
https://textbookfull.com/product/learn-centos-linux-network-
services-vazquez-2/
https://textbookfull.com/product/ubuntu-and-centos-linux-server-
administration-md-tanvir-rahman/
https://textbookfull.com/product/network-programming-with-go-
learn-to-code-secure-and-reliable-network-services-from-
scratch-1st-edition-adam-woodbeck/
Learn Linux in a Month of Lunches 1st Edition Steven
Ovadia
https://textbookfull.com/product/learn-linux-in-a-month-of-
lunches-1st-edition-steven-ovadia/
https://textbookfull.com/product/mastering-kali-linux-for-
advanced-penetration-testing-secure-your-network-with-kali-linux-
the-ultimate-hackers-arsenal-second-edition-velu/
https://textbookfull.com/product/digital-forensics-with-kali-
linux-enhance-your-investigation-skills-by-performing-network-
and-memory-forensics-with-kali-linux-3rd-edition-parasram/
https://textbookfull.com/product/kali-linux-2018-windows-
penetration-testing-conduct-network-testing-surveillance-and-pen-
testing-on-ms-windows-using-kali-linux-2018-2nd-edition-halton/
https://textbookfull.com/product/learn-amazon-web-services-in-a-
month-of-lunches-1st-edition-david-clinton/
Learn CentOS
Linux Network
Services
—
Antonio Vazquez
Learn CentOS Linux
Network Services
Antonio Vazquez
Learn CentOS Linux Network Services
Antonio Vazquez
Madrid, Madrid, Spain
ISBN-13 (pbk): 978-1-4842-2378-9 ISBN-13 (electronic): 978-1-4842-2379-6
DOI 10.1007/978-1-4842-2379-6
Library of Congress Control Number: 2016960292
Copyright © 2016 by Antonio Vazquez
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part
of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission
or information storage and retrieval, electronic adaptation, computer software, or by similar or
dissimilar methodology now known or hereafter developed. Exempted from this legal reservation are
brief excerpts in connection with reviews or scholarly analysis or material supplied specifically for
the purpose of being entered and executed on a computer system, for exclusive use by the purchaser
of the work. Duplication of this publication or parts thereof is permitted only under the provisions
of the Copyright Law of the Publisher’s location, in its current version, and permission for use must
always be obtained from Springer. Permissions for use may be obtained through RightsLink at the
Copyright Clearance Center. Violations are liable to prosecution under the respective Copyright Law.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol
with every occurrence of a trademarked name, logo, or image, we use the names, logos, and images only
in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of
the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are
not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject
to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of
publication, neither the author nor the editors nor the Publisher can accept any legal responsibility for
any errors or omissions that may be made. The Publisher makes no warranty, express or implied, with
respect to the material contained herein.
Managing Director: Welmoed Spahr
Acquisitions Editor: Louise Corrigan
Development Editor: James Markham
Technical Reviewer: Massimo Nardone
Editorial Board: Steve Anglin, Pramila Balen, Laura Berendson, Aaron Black, Louise Corrigan,
Jonathan Gennick, Todd Green, Celestin Suresh John, Nikhil Karkal, Robert Hutchinson,
James Markham, Matthew Moodie, Natalie Pao, Gwenan Spearing
Coordinating Editor: Nancy Chen
Copy Editor: Michael G. Laraque
Compositor: SPi Global
Indexer: SPi Global
Artist: SPi Global
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring
Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail
orders-ny@springer-sbm.com, or visit www.springer.com. Apress Media, LLC is a California LLC and
the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc).
SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail rights@apress.com, or visit www.apress.com.
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use.
eBook versions and licenses are also available for most titles. For more information, reference our
Special Bulk Sales–eBook Licensing web page at www.apress.com/bulk-sales.
Any source code or other supplementary materials referenced by the author in this text are available
to readers at www.apress.com. For detailed information about how to locate your book’s source code,
go to www.apress.com/source-code/.
Printed on acid-free paper
This book is dedicated to my family, especially to my parents, who recently had to
endure some difficult times. I love you both.
Contents at a Glance
v
Contents
vii
■ CONTENTS
2.7. SELinux........................................................................................... 53
■Chapter 3: Networking ................................................................. 59
3.1. IPv4 ................................................................................................ 59
3.1.1. Special Addresses ........................................................................................ 60
3.1.2. Unicast, Multicast, and Broadcast ................................................................ 60
3.1.3. IPv4 Configuration in CentOS ........................................................................ 61
3.2. IPv6 ................................................................................................ 67
3.3. Networking Tools ............................................................................ 69
3.3.1. netstat .......................................................................................................... 69
3.3.2. lsof ................................................................................................................ 70
3.3.3. nmap............................................................................................................. 70
3.3.4. ping............................................................................................................... 72
3.3.5. ping6............................................................................................................. 72
viii
■ CONTENTS
ix
■ CONTENTS
x
■ CONTENTS
xi
■ CONTENTS
xii
About the Author
xiii
About the Technical
Reviewer
xv
Acknowledgments
I’d like to extend my gratitude to everybody at Apress, especially to those with whom I’ve
had the pleasure of working directly: Louise Corrigan and Nancy Chen. I would also like
to thank the technical reviewer, Massimo Nardone. They all helped me a lot.
Of course, I can’t forget my wife, who is also my biggest fan and always offers me her
support and patience.
xvii
Introduction
Many things have changed since that day in which a young Finnish student named
Linus Torvalds decided to post a message in a forum, searching for help with the
development of a new operating system. He hardly could have imagined that there
would be so many people eager to collaborate. And what had started as a hobby
became an efficient operating system (OS) used today by thousands of companies and
users around the world.
Linus decided to make this OS free for everybody to use, share, study, and modify
the code. So he licensed the code under the GNU license. This way, it was possible for
everybody to have access to the source code and modify it according to their likes and/
or needs. This resulted in many companies, universities, etc., having their own Linux
distributions.
Even though many of these distributions have remained confined to small areas
of influence, such as universities or official departments, a few have achieved general
recognition over the years. A few well-known examples include Red Hat, SUSE, Debian,
and Ubuntu.
The Red Hat Linux distribution system, developed by the Red Hat company is,
undoubtedly, one of the most important and influential. Red Hat has made many relevant
contributions to the Linux community, for example, the Red Hat Package Manager
(RPM), used by several other distributions, and Suse.
Red Hat used to publish desktop, as well as server, editions of its OS, and these
were made freely available for anyone to use. But in the year 2004, the company decided
that its OS would be provided only to clients. Obviously, this concerns only the binary
distributions, as the source code has to be made publicly available to comply with the
GNU license.
From that moment on, two new projects emerged with the aim of trying to maintain
a Red Hat clone that would be freely available to everyone. The first project was called
Fedora. It was sponsored by Red Hat itself and was conceived as some sort of beta Red
Hat platform.
Many users thought that Fedora was OK as a desktop platform, but it was by no
means a reliable enterprise solution. In order to fulfill this gap, many Linux professionals
and enthusiasts gathered around a new project called CentOS (Community Enterprise
Operating System), whose main goal was to become a freely available robust enterprise
operating system.
Today, CentOS is a reliable, efficient server operating system used by hundreds of
companies to provide critical services.
xix
■ INTRODUCTION
Audience
Some experience with computers is expected of readers of this book. Some previous
Linux experience is useful, if not absolutely necessary. The only requirement, however, is
the will to learn!
Conventions
The Code style attribute has been applied to file names, paths, commands, and URLs.
Feedback
I would really appreciate your opinions, suggestions, questions, or criticisms regarding
this book. Please feel free to e-mail me at antoniojvv@yahoo.es. Note, however, that I
cannot promise to respond to everyone.
xx
CHAPTER 1
Installation
1.1. CentOS 6
As it usually happens, there is more than one way to install CentOS on a computer. So,
depending on the way we initially boot the server and the source of the installation
packages, we have many options.
• We can boot and install the system from a DVD. This is probably
the most straightforward option, and the right choice if you only
have to install a couple of servers. We boot the server from the
DVD, and we install all the software from the DVD too.
• We can also use a CentOS Network netinstall DVD to boot the
server and then install the packages from a server in our local
network or from the Internet. This is a good choice if we have to
install a lot of servers.
• We could also use a USB device to boot the server. In this case,
we first prepare the USB device by using software packages
such as UNetbootin,1 and we also have to download the CentOS
installation files. Once the USB device is ready, we can use it to
boot the server and then choose whether to install from a local or
a network repository.
1
SourceForge, “UNetbootin: Bootable live USB creator for Ubuntu, Fedora, and Linux distributions,”
https://sourceforge.net/projects/unetbootin/, 2016.
Nevertheless, in order to keep things simple, in this book, we will avail ourselves only
of the typical DVD installation. The first thing one must do is to get the installation DVDs.
These can be downloaded from the CentOS official site.2 At the time of writing this book,
the ISO files could be downloaded from the links available from http://wiki.centos.
org/Download.3 We can choose the exact version we want to install, the architecture (32 or
64 bits), and the type of installation (minimal, network, etc.). We will download and burn
the ISO files CentOS-6.2-i386-bin-DVD1.iso and CentOS-6.2-i386-bin-DVD2.iso.
Once we have the DVDs, installation is fairly simple. We make sure that the computer is
configured to boot from a DVD, and we restart it with the first installation DVD inside.
After a few seconds, we’ll see the screen in shown in Figure 1-1.
We’ll select the first option, “Install or upgrade an existing system.” This will launch
the actual installation program. Now we are offered the possibility of checking the
installation media (Figure 1-2). Once we are sure that there is no problem with the DVDs,
we click Skip.
2
CentOS, “The CentOS Project,” http://centos.org/, 2016.
3
CentOS, http://wiki.centos.org/Download, 2016.
2
CHAPTER 1 ■ INSTALLATION
Now the system will init the graphical installer (Figure 1-3).
3
CHAPTER 1 ■ INSTALLATION
From the next screens, we’ll have to choose the language and the keyboard layout
(Figures 1-4 and 1-5).
4
CHAPTER 1 ■ INSTALLATION
5
CHAPTER 1 ■ INSTALLATION
After clicking the Next button, a warning appears (Figure 1-7), telling us that all data
in the disk will be lost. As this is either a blank disk or a disk whose data are no longer
needed, we click Yes.
6
CHAPTER 1 ■ INSTALLATION
The program now requests us to enter the name and the domain of the computer
we are about to install (Figure 1-8). We can write this information now or do it once the
installation is complete. We click Next.
From the upcoming screens, we’ll have to choose the time zone as well as the root
password (Figures 1-9 and 1-10).
7
CHAPTER 1 ■ INSTALLATION
8
CHAPTER 1 ■ INSTALLATION
Now we are offered several options before starting the actual installation (Figure 1-11).
We can choose to use the whole disk, no matter what Linux or non-Linux partitions might
exist on the disk, use only free disk space, customize the disk partitioning, etc. As the
default partitioning scheme is acceptable to start, we choose the first option. Although,
if we already had clearly in mind the role the server was to play in the network, we would
probably have to customize the partitioning layout to create separate partitions or
volumes for the different directories: /home, /var, etc.
We receive another warning (Figure 1-12), reminding us that the changes are going
to be written on disk, and we are requested to specify what software package we want
to install. There are several predefined sets of software, database server, web server, etc.
We’ll choose the Minimal option (Figure 1-13) and install later the different software
packages, as we need them.
9
CHAPTER 1 ■ INSTALLATION
10
CHAPTER 1 ■ INSTALLATION
After a few minutes, the installation will be over (Figure 1-15), and we’ll have to
reboot the system.
11
CHAPTER 1 ■ INSTALLATION
Once the boot process is complete, we have a working CentOS server (Figure 1-16).
12
CHAPTER 1 ■ INSTALLATION
1.2. CentOS 7
As you saw in section “CentOS 6,” there are many types of installations to choose from.
As we did previously when installing CentOS 6, we’ll also install CentOS 7 from the
installation DVD. At the time of writing of this book, this could be downloaded from the
official site.4 After downloading the ISO file, we can burn it onto a DVD. After that, we
are ready to boot a server with the installation DVD inserted, as long as the computer
is configured to boot from a DVD. After a few seconds, we’ll see the screen shown in
Figure 1-17.
4
CentOs, http://www.centos.org/download/, 2016.
13
Another Random Scribd Document
with Unrelated Content
4-8-2 Type Passenger Locomotive—Chicago, Rock Island & Pacific
R. R.
Built by American Locomotive Company.
Machine Shop
Schenectady, N. Y., Works, American Locomotive Company.
[552]
[553]
[554]
[555]
A man who had been tied in a great city all his life made his first visit
the other day to an up-to-date farm. He was so surprised at what he
saw that he wrote a letter describing his emotions. Some of it is
worth quoting because it shows a picture of the modern farm as it
was cast upon the eye of a man who had never seen it before.
“I was whisked from the railway station in a big touring car, through
beautiful country. Then we turned up a flower and shrub lined
concrete driveway, and stopped by a home, capacious and modern.
Inside I found electric lights, electric iron and bathroom with running
water.
“I found that the good man of the house had his own electric light
and water plant, run by kerosene engines, that his cows were milked
automatically, that he pulled his plows, harrows, drills, manure
spreader and binder with a kerosene tractor, that his hired men went
about the farm doing everything as they rode on some machine, that
he went to church and town in an automobile, and that he delivered
the products of his farm to market with a motor truck. Everything
was managed like a factory. Things went forward with order and with
assurance. Everyone was busy and happy.”
This is an optimistic picture of one of our best farms, but compare it
with the best that could be found only a few hundred years ago. The
best farmer of those days held all the land for miles around and lived
in a castle in the middle of it. The castle was dark and cold and was
made of rough stones fitted together. The poor farmers were serfs
and came two or three days out of a week to their master’s house to
work. Those were the great days of their lives, for then they ate of
the master’s food.
Food—that was the problem of those long tired years which dragged
through the ages, when nearly everyone was a farmer, and a farmer
with crude tools held in his hands. Time was when practically the
whole world went to bed hungry and rose again in the morning
craving food, just as half the millions of India do today because they
do with their hands what a machine should do.
The Motor Truck May be Used by the Farmer Even
in Hilly and Mountainous Places
People in the hungry, unfed ages grew so used to privation that even
the philosophers accepted sorrow and woe as a matter of course and
dilated upon their virtues for chastening the human soul. “It is better
to go to the house of mourning than the house of mirth,” said one of
the prophets, and such words brought comfort to the hungry,
miserable millions who had to mourn and go hungry whether it was
to their advantage or not.
The Reaping Hook was the First Implement Used for Harvesting
Grain of which we have Record
This pictures the reaping hook as still used in India.
Today the years glide by like pleasant pictures. We are fed, busy and
happy. We almost let the dead bury their dead today while the living
drive forward their tasks, achieving as much in a year as the old ages
did in twenty. We have learned to feed ourselves and the food fills
our bodies and brains with energy which must find expression in
useful accomplishment. “Blessed is he who has found his work to do,”
we say nowadays, “but thrice blessed is he who has found a machine
to do it for him.”
Thread your way back through history to the time when the slender
lives of men expanded into full and useful employment, and you will
find that, so far as raising the world’s food is concerned, it all began
with the invention of the reaper in only the last century. It is
interesting to know something of the precarious entry of this
machine and something of the dark background from which it
emerged.
The Cradle.
Gradually the blade of the scythe was made lighter, the handle was
lengthened, and fingers added to collect the grain and carry it to the
end of the stroke. With the cradle the cut swath could be laid down
neatly for drying preparatory to being bound into bundles. This tool is
distinctly an American development. The colonists, when they settled
in this country, probably brought with them all the European types of
sickles and scythes, and out of them evolved the cradle.
With the cradle in heavy grain an experienced man could cut about
two acres a day, and another man could rake and bind it into
sheaves, so that two men with the cradle could do the work of six or
seven men with sickles.
The American cradle stands at the head of all hand tools devised for
the harvesting of grain. When it was once perfected, it soon spread
to all countries with very little change in form. Although it has been
displaced almost entirely by the modern reaper, yet there are places
in this country and abroad where conditions are such that reaping
machines are impractical and where the cradle still has work to do.
[560]
The Mowing Machine has Replaced the Scythe for Cutting Hay,
and the Kerosene Tractor has Replaced Expensive Horse Power
for Pulling the Mowers
The first practical reaper taken into the field in 1831 embodied the
essential parts of the reaper with which we are familiar. It had a
platform for receiving the grain, a knife for cutting it, supported by
stationary fingers over the edge, and a reel to gather it. The driver of
the machine rode one of the horses, while the man who raked off the
grain walked by the side of the machine.
During all these years from 1831 to 1844 Mr. McCormick was
diligently at work changing, testing and experimenting. In 1845 he
secured a second patent, which embodied many improvements—the
principal ones referring to the cutting mechanism.
[565]
In this year, Mr. McCormick started for the western prairie, and in
1847 built his own factory in Chicago, thus starting the world’s
greatest reaper works. This factory, known as “McCormick Works,” is
still in progress. It covers today more than 120 acres in the heart of
Chicago, and has an annual capacity of 375,000 machines of all
types.
The third step in the development of the reaper was the addition to
the machine of a seat for carrying the raker. The machine built in
1831 required that the raker walk by the side of the machine. In
1845 Mr. McCormick added the seat, patent for which was added in
1847. This seat which carried the raker enabled him while riding to
rake the grain from the platform and deposit it in gavels on the
ground. This type of reaper, patented in 1847, is the one taken by
Cyrus H. McCormick to the first world’s fair held in London, England,
in 1851, and about which the records of that exposition state “The
McCormick reaper is the most valuable article contributed to this
exposition, and for its originality and value and perfect work in the
field it is awarded the council medal.”
This same reaper received the grand prize in Paris in 1855 and is the
reaper which created so much surprise in the world’s fair in London
that the comments made by the press demonstrated beyond a doubt
that England had not as yet built a successful reaper. In 1858 the
machine was further improved by substituting an automatic rake for
the raker on the machine.
Many other patents were granted from time to time until 1870, when
the foundation features of all reapers had been invented and
substantially perfected. The reaper is still used extensively, especially
in foreign countries.
The interest in this machine centers not in its development as used
today, but in the fact that it led to the invention and perfection of the
self-binder.
The prototype of all machines designed to bind the grain before
being delivered to the ground is the Marsh harvester. It is the half-
way mark, the child of the reaper and the parent of the self-binder.
The original patent for this machine was granted August 17, 1858, to
two farmer boys of De Kalb, Illinois, the Marsh brothers.
Previous to this time, attempts had been made to build harvesting
machines which would bind the grain before delivered to the ground,
but not one could be considered a success. At the time the Marsh
harvester began seeking a place in the market, about 1860, reapers
—hand-rakers, self-rakers, and droppers—held the trade substantially
to the exclusion of any other kind of harvesting machine.
[567]
The Self-Binder.
The development of the automatic binder followed quickly after the
introduction of the Marsh harvester, although attempts were made to
perfect this machine as early as 1850.
[569]
[571]
A Tractor Pulling Five Harvester Binders
These machines cut a swath 40 feet wide in the grain field, gathering the grain
into bundles and dropping them alongside to be picked up by the sweep rake.
This was the situation in the harvesting industry about the time that
William Deering took an active interest. He looked about for a better
machine. He found John F. Appleby, who, in 1878, had perfected a
twine binder attachment. When Deering saw the strong steel arms
flash a cord around a bundle of grain, tie a knot, cut the cord and
fling off the sheaf, he knew he had what the world needed. Appleby
began working on his invention in 1858, but accomplished nothing
until 1869 when he took out his first patent on a “wire binder.” In
1874 he began what is known as the Appleby twine binder, operating
one in 1875 and 1876 and several in 1877. In 1879 Deering bought
out Gammon, joined forces with Appleby, moved the factory from
Plano to Chicago in 1880, and began putting out twine binders. In
1881 McCormick, also, and Champion began building the Appleby
binder.
The Progressive Farmer now Uses a Mechanical
Manure Spreader to Increase the Productiveness
of His Land
[573]
A Small Kerosene Tractor can Pull Two or Three Grain Drills Fastened Together by
Special Tractor Hitches
Few businesses have had a more spectacular rise than the motion-
picture industry. It may be true that there are other industries of
recent growth that are more highly capitalized than the motion-
picture business. I shall not make any comparisons nor look up
statistics, but will present some facts about an enterprise that,
scientifically, industrially and commercially, is one of the great
wonders of the world.
It is fair to estimate that more than $375,000,000 is invested in this
business in the United States. It looks like an exaggeration or as if
the typesetter had slipped in several extra ciphers by mistake, does it
not? Nevertheless, the estimate is said to be extremely conservative.
In the first place, it concerns every branch of the business, of which
there are five. Taken in their natural order there are: 1. The
manufacture of motion-picture cameras. 2. The manufacture of films.
3. The taking of the pictures. 4. The manufacture of the projecting
machines. 5. The exhibition of the pictures.
The projecting machine is the subject of this story. One sees very
little about it in the newspapers and popular magazines, in spite of
the fact that it is the keystone, so to speak, of the motion-picture
industry. Of the entire business, in all its ramifications, this machine
is the most important not only from a technical standpoint, but as
regards both the pleasure and safety of the public. Here, again, a
great deal of money is invested. Its manufacture involves costly and
highly specialized machinery, the most intelligent of mechanics and
the constant thought and endeavor of the men at the head of the
business.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com