Essential System Administration 3rd Edition Æleen Frisch 2024 scribd download
Essential System Administration 3rd Edition Æleen Frisch 2024 scribd download
com
https://ebookname.com/product/essential-system-
administration-3rd-edition-aeleen-frisch/
OR CLICK BUTTON
DOWNLOAD EBOOK
https://ebookname.com/product/tru64-unix-system-administration-1st-
edition-steven-hancock/
ebookname.com
https://ebookname.com/product/frommer-s-hawaii-from-80-a-day-3rd-
edition-jeanette-foster/
ebookname.com
https://ebookname.com/product/unix-system-administration-a-beginner-s-
guide-1st-edition-maxwell/
ebookname.com
https://ebookname.com/product/molecular-and-cellular-toxicology-an-
introduction-1st-edition-stanley/
ebookname.com
The Psychopath s Bible For the Extreme Individual 2nd
Edition Christopher S. Hyatt
https://ebookname.com/product/the-psychopath-s-bible-for-the-extreme-
individual-2nd-edition-christopher-s-hyatt/
ebookname.com
https://ebookname.com/product/global-analysis-of-dynamical-
systems-1st-edition-h-w-broer/
ebookname.com
https://ebookname.com/product/sleep-deprivation-stimulant-medications-
and-cognition-1st-edition-nancy-j-wesensten/
ebookname.com
https://ebookname.com/product/the-facebook-era-clara-chung/
ebookname.com
Secrets of the Russian Chess Masters Fundamentals of the
Game Volume 1 1st Edition Lev Alburt
https://ebookname.com/product/secrets-of-the-russian-chess-masters-
fundamentals-of-the-game-volume-1-1st-edition-lev-alburt/
ebookname.com
Essential System
Administration
THIRD EDITION
Essential System
Administration
Æleen Frisch
Copyright © 2002, 1995, 1991 O’Reilly Media, Inc. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly Media, Inc. books may be purchased for educational, business, or sales promotional use.
Online editions are also available for most titles (safari.oreilly.com). For more information contact
our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com.
Printing History:
August 2002: Third Edition.
September 1995: Second Edition.
October 1991: First Edition.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered
trademarks of O’Reilly Media, Inc. Essential System Administration, Third Edition, the image of an
armadillo, and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations
used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where
those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark claim,
the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and author
assume no responsibility for errors or omissions, or for damages resulting from the use of the
information contained herein.
[M] [05/07]
For Frank Willison
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
vii
6. Managing Users and Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Unix Users and Groups 222
Managing User Accounts 237
Administrative Tools for Managing User Accounts 256
Administering User Passwords 277
User Authentication with PAM 302
LDAP: Using a Directory Service
for User Authentication 313
7. Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Prelude: What’s Wrong with This Picture? 331
Thinking About Security 332
User Authentication Revisited 339
Protecting Files and the Filesystem 348
Role-Based Access Control 366
Network Security 373
Hardening Unix Systems 387
Detecting Problems 391
Table of Contents | ix
Stem: Simplified Creation of Client-Server Applications 932
Adding Local man Pages 942
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1097
x | Table of Contents
Preface
This book covers the fundamental and essential tasks of Unix system administra-
tion. Although it includes information designed for people new to system administra-
tion, its contents extend well beyond the basics. The primary goal of this book is to
make system administration on Unix systems straightforward; it does so by provid-
ing you with exactly the information you need. As I see it, this means finding a mid-
dle ground between a general overview that is too simple to be of much use to
anyone but a complete novice, and a slog through all the obscurities and eccentrici-
ties that only a fanatic could love (some books actually suffer from both these condi-
tions at the same time). In other words, I won’t leave you hanging when the first
complication arrives, and I also won’t make you wade through a lot of extraneous
information to find what actually matters.
This book approaches system administration from a task-oriented perspective, so it
is organized around various facets of the system administrator’s job, rather than
around the features of the Unix operating system, or the workings of the hardware
subsystems in a typical system, or some designated group of administrative com-
mands. These are the raw materials and tools of system administration, but an effec-
tive administrator has to know when and how to apply and deploy them. You need
to have the ability, for example, to move from a user’s complaint (“This job only
needs 10 minutes of CPU time, but it takes it three hours to get it!”) through a diag-
nosis of the problem (“The system is thrashing because there isn’t enough swap
space”), to the particular command that will solve it (swap or swapon). Accordingly,
this book covers all facets of Unix system administration: the general concepts,
xi
xii | Preface
BSD Version 7
(1977) (1979)
XENIX
(1979 onward)
System III
(1982)
For a Unix family tree at the other extreme of detail, see http://perso.
wanadoo.fr/levenez/unix/. Also, the opening chapters of Life with UNIX,
by Don Libes and Sandy Ressler (PTR Prentice Hall), give a very enter-
taining overview of the history of Unix. For a more detailed written his-
tory, see A Quarter Century of UNIX by Peter Salus (Addison-Wesley).
Preface | xiii
Fig. 8.
Fig. 9.
What, then, is this mechanism and how does it act? The gland is a
compound tubular one, its internal cavity being prolonged into the
duct which opens into the mouth. The saliva prepared in the gland
issues from this duct. Blood is carried to the gland by twigs of the
facial artery, and, after circulating through it, is carried away by
factors of the jugular vein. Two nerves supply the gland: one is the
chorda tympani, a branch of a cranial nerve, and the other is a
sympathetic nerve. Lymph also leaves the gland by a little vessel.
Now suppose we have laid bare all this mechanism in a living animal
and make experiments upon it. If we stimulate the chorda tympani
there is a copious flow of thin watery saliva, but if we stimulate the
sympathetic there is a less copious flow of thick viscid saliva. Why is
this? We find on closer analysis that the chorda contains fibres which
dilate the small arteries so that there is an increased flow of blood
through the gland; but that, on the other hand, the sympathetic
contains fibres which constrict the arteries, thus leading to a reduced
flow of blood. This accounts for the fact that “chorda-saliva” is
abundant and thin, while “sympathetic-saliva” is scarce and thick. It
was thought at one time that the chorda contained fibres which
stimulated the gland to produce watery saliva, while the sympathetic
contained fibres which stimulated it to produce mucid saliva. This,
however, is not the case. Both nerves contain the same kind of
secretory fibres: their other fibres differ mainly in that they act
differently on the arteries.
It might be the case—indeed it was at one time thought that it was
the case—that secretion of saliva was simply a matter of blood-flow:
an abundant arterial circulation gave rise to abundant saliva, a
sparse flow to a sparse saliva. Undoubtedly the secretion depends
on blood supply, but not solely. If it did, then the whole process
might be conceived to be a very simple mechanical one—filtration or
diffusion of the saliva from the blood stream through the thin walls
of the blood vessels, and the walls of the tubules into the cavity of
the gland. If this were the case, then the liquid in the gland would
be the same in composition and concentration as the liquid part of
the blood—the plasma. But it is really different in composition and it
is not so concentrated. Now osmotic pressure—on the action of
which so much is based—cannot help us, for the liquid in the gland
is less concentrated than that in the blood vessels, so that water
ought to pass from gland to blood instead of from blood into gland.
Again, if we tie the duct, so that the saliva cannot escape, secretion
still goes on, though the hydrostatic pressure of saliva in the cavity
of the gland may be considerably greater than that of the liquid in
the blood vessels. Yet again, if we stop the blood flow by tying the
artery, secretion of saliva may still go on for a time.
Therefore the only physical agencies we can think of do not explain
the secretion. The latter is actually the work of the individual cells,
stimulated by the nerves. If the volume of the gland be measured
just while it is being stimulated to secrete, it will be found that the
organ becomes smaller, yet while it is being stimulated the blood-
vessels are being dilated so that the volume of the whole structure
ought to become greater. Obviously part of the substance of the
gland is being emptied out through its duct as the secretion.
If we examine the cells of the gland in various states we see clearly
that granules of some material, different in nature from the
substance of the protoplasm itself, are being formed within them.
Evidently these granules swell up during secretion and discharge
their contents into the ducts. Further changes in the characters of
the cell-substance, and in the nucleus, can be observed, and all
these indicate that the protoplasm of the cells, as the result of
stimulation, elaborates certain substances; that these substances are
then washed out, so to speak, into the duct by the withdrawal of
water from the cell; and that thereafter the cell absorbs fresh
nutritive material from the lymph which exudes from the blood
vessels, along with water. The distinctive part of the whole train of
processes is, then, this elaboration of material by the cells
themselves; while the concomitant changes in the calibre of the
blood vessels and in the flow of blood and lymph are subsidiary
ones. In the process of secretion of saliva energy is absorbed from
the chemical substances of the blood to bring about the passage of
water from a region of high to a region of low osmotic pressure;
oxygen and nitrogen, with other elements of course, are withdrawn
from the arterial blood stream for the purpose of the secretion, and
carbon dioxide and other substances are given off to the venous
blood and lymph.
The problem thus is pushed back from the mechanical events
occurring in the nervous and circulatory processes, to the physico-
chemical ones occurring in the cells of the gland tubules; and it thus
becomes much more obscure. It is true that we can formulate a
hypothesis which describes, in a kind of way, these intra-cellular
metabolic changes, in terms of physico-chemical reactions, and,
without doubt, reactions of this kind must occur within the cell. But
if we could test any such hypothesis as easily as the mechanical
ones suggested, should we find it any more self-sufficient? 19
Irritability and contractility are general properties of the organism.
These properties are illustrated by the irritability of an Amœba or
Paramœcium to stimuli of many kinds; by the movements of the
pseudopodia of the former animal, or of the cilia of the latter; by the
nervous irritability of the higher animal, and the contraction of its
muscles when they are stimulated. They are among the fundamental
properties or functions of living protoplasm, and their study is of
paramount interest, and carries us to the very centre of the problem
of the activities of the organism. Naturally physiologists have never
ceased to attempt to describe irritability and contractility in terms of
physics, but though we may be quite certain that the things that do
occur in these phenomena are controlled physico-chemical reactions,
it must be remembered that what we positively know about their
precise nature is exceedingly little.
What is the nature of a nervous impulse? When a receptor organ is
stimulated, as, for instance, when light impinges on the cone cells of
the retina, or when the nerve-endings in a “heat-spot” in the skin
are warmed, or when the wires conveying an electric current are laid
on a naked nerve, an impulse is set up in the nerve proceeding from
the place stimulated, and we must suppose that approximately the
same amount of energy moves along the nerve as was
communicated to the receptor or the nerve itself by a stimulus of
minimal strength. How does it so move? Several facts of capital
importance result from the experimental work. (1) The impulse
travels with a velocity variable within certain limits, say from 8 to 30
metres per second; (2) it travels faster if the temperature is raised
(up to a certain limit); (3) it is difficult to demonstrate that the
passage of this impulse is accompanied by definite chemical changes
in the nerve substance: it is stated that carbon dioxide is produced,
but this is not certainly proved; (4) an electric current is produced in
the nerve as the result of stimulation; (5) no heat is produced, or at
least the rise of temperature, if it occurs, is less than 0.0002° C.
Thus it is quite certain that physical changes accompany the
propagation of the nerve-impulse, for the latter has a certain
velocity, which depends on the temperature, and an electric change
also occurs in the substance of the nerve. Is this electric change the
actual nerve impulse? It is hardly likely, since the velocity of the
impulse is very much less than that of the propagation of an electric
change through a conductor; besides, the passage of the impulse is
not accompanied by a measurable heat evolution, although the flow
of electricity along a poor conductor must generate heat and
dissipate energy. Is it a chemical change? Then we should be able to
observe metabolism in the nerve substance—that is if the energy-
change is a thermodynamic one—while it is not at all certain that
metabolic changes do occur. Nevertheless it seems probable that a
physico-chemical change is actually propagated when we consider
the chemical specialisation of the substance of the axis-cylinder of
the nerve. Now the velocity of propagation of the nervous impulse is
of the same order of magnitude as that of an explosive change in
chemical substances (using the term “explosion” to connote
chemical disintegrations rather than combustions). If we imagine a
long rod of dynamite, or picric acid, or a long strand of loosely-
packed gun-cotton to be exploded by percussion at one end, then a
transmission of the chemical disintegration of any of these
substances will pass along the rod, etc., with a velocity which will
certainly vary with the physical condition of the material. It would be
a high velocity in a rod of dynamite, or fused picric acid, but a lower
velocity in a loosely aggregated strand of gun-cotton, or a trail of
picric acid powder. Is this what happens in the nerve when an
impulse travels along it? Obviously not, since the substance of the
nerve is not altered appreciably, while that of the explosive
substance passes into other chemical phases. We might imagine,
then, such a change in the nerve fibrils as that of a reversible
transformation of some chemical constituent:—
(2) (1)
:a + b:a + b:a + b:a + b:a + b:
: : : : : :
:c + d:c + d:c + d:c + d:c + d:
Let us imagine the substance of the fibril to be composed of, or at
least to contain, the substances a + b which dissociate reversibly
into the substances c + d. At any moment, and in any particular
physical state, as much of a and b pass into c and d as c and d pass
into a and b. There will be equilibrium. But now let a stimulus alter
the physical conditions: prior to the stimulus the phase was am + bn
= cp + dr—the suffixes m, n, p, r, denoting the concentrations of a,
b, c, and d—but after the stimulus the phase may be am1 + bn1 =
cp1 + dr1. Now the element of the nerve substance (1) forms a
system with the element (2). The condition in (2) is am + bn =
cp + dr, and that of (1) am1 + bn1 = cp1 + dr1, but these two
together now fall into a new state of equilibrium and this is
transmitted along the whole nerve-fibril with a velocity which
belongs to the order of magnitude of that of chemical changes. If
the stimulus remains constant (a constant electric current for
instance), the new condition of equilibrium will be established
throughout the whole length of the fibril and the nervous impulse
will be a momentary one (as it is in this case). But if the stimulus is
an intermittent one (an interrupted electric current, light-vibration,
sound-vibrations), then in the intervals the former condition of
equilibrium will become re-established and the nervous impulse will
be intermittent (as it is). There would be no work done on the whole
in the changes, except that done by the transmission of the changed
state of equilibrium to the substance of the effector organ in which
the nerve-fibril terminates—the substance of a muscle fibre, or the
cell of a secretory gland, for instances. There would, probably, be a
certain dissipation of energy as in the case of the propagation of an
electric impulse through a poor conductor, but all our knowledge of
the chemistry of the nerve fibre points to this amount of dissipation
as tending to vanish.
Something analogous to this may be expected to take place in a
muscle fibre when it contracts; except that, of course, energy is
transformed in this case. What precisely does happen we do not
know and at the present time no physico-chemical hypothesis of the
nature of muscular contraction exactly describes all that can be
observed to take place. Certain positive results have, of course, been
obtained by chemical and physical investigation of the contracting
muscle: carbon dioxide is given off to the lymph and blood stream,
and the amount of this is increased when an increased amount of
work is done by the muscle; heat is produced and this too increases
with the work performed; glycogen is used up, and lactic acid is
produced; finally oxygen is required, and more oxygen is required by
an actively contracting muscle than by a quiescent one. Now the
obvious hypothesis correlating all these facts is that the muscle
substance is oxidised, and that the heat so produced is transformed
into mechanical energy. “We must assume,” says a recent book on
physiology, “that there is some mechanism in the muscle by means
of which the energy liberated during the mechanical change is
utilised in causing movement, somewhat in the same way as the
heat energy developed in a gas-engine is converted by a mechanism
into mechanical movement.”
Now, must we assume anything of the kind? To begin with, life goes
on, and mechanical energy is produced in many organisms living in a
medium which contains no oxygen. Anaerobic organisms are fairly
well known, and we cannot suppose that in them energy is
generated by the combustion of tissue substance in the inspired
oxygen. A muscle removed from a cold-blooded animal will continue
to contract in an atmosphere containing no oxygen, and it will
continue to produce carbon dioxide. It is true that the contractions
soon cease, even after continued stimulation under conditions
excluding the fatigue of the muscle, but do the contractions cease
because the oxygen supply is cut off, or because the muscle dies in
these conditions? We know that some complex chemical substance is
disintegrated during contraction and that mechanical energy and
heat are produced and that carbon dioxide is also produced. We
know that the carbon contained in the latter gas corresponds
roughly with the carbon contained in the muscle substance which
undergoes disintegration, but does all this justify us in saying that
this substance is oxidised in order that its potential chemical energy
may be transformed into mechanical energy? Obviously not, since
we might equally well suppose that the complex metabolic substance
of the muscle splits down into simpler substances and that in this
transformation energy is generated. Suppose that these simpler
substances are poisonous and that they must be removed as rapidly
as formed. The rôle of the oxygen may be to oxidise them, thus
transforming them into carbon dioxide, an innocuous substance
which can be carried away quickly in the blood stream. This line of
thought, according to which the rôle of oxygen is an anti-poisonous
one, is held at the present day by some physiologists, and many
considerations appear to support it; the existence of “oxidases,” for
instance, enzymes which produce oxidations which would not
otherwise occur in their absence. Such enzymes exist in very many
tissues, and they may, apparently, be present in an inactive form,
requiring the agency of a “kinase” before they are able to act.
The usual view among physiologists is that the muscle fibre is a
thermodynamic apparatus transforming the heat generated during
metabolism into mechanical energy. How is this transformation
effected? It cannot be said that we have any one hypothesis more
convincing than another. It has been suggested that alterations of
surface tension play a part, or that the heat produced by oxidation
causes the fibre to imbibe water and shorten. Engelmann has
devised an artificial muscle consisting of a catgut string and an
electrical current passing through a coil of wire, and by means of
this he has reproduced the phenomena of simple contraction and
tetanus. But it remains for future investigation to verify any one of
these hypotheses.
When Huxley published his Physical Basis of Life, probably few
physiologists had any doubt that protoplasm was a definite chemical
substance, differing from other organic substances only by its much
greater complexity. But in 1880 Reinke and Rodewald published the
results of an analysis of the substance of a plant protoplasm and
these appear to have demonstrated that the substance was really a
mixture of a number of true chemical compounds and was not a
single definite one. Now all of these substances might exist apart
from protoplasm, and in the lifeless form, and a simple mixture of
them could hardly bring forth vital reactions. These results were
followed by the morphological study of the cell—the discovery of the
architecture of the nucleus, and so on, and so opinion began to turn
to the hypothesis that the vital manifestations of protoplasm were
the result of its structure. Microscopical examination of the cell
appeared to disclose a definite arrangement, the “foam” or “froth” of
Butschli, for instance. But, again, it was easily shown that the foam,
or alveolar structure of protoplasm was merely the expression of
physical differences in the substances composing the cell-stuff—they
reduced to phenomena of surface tension and the like. Artificial
protoplasm and artificial Amœbæ were made—at least mixtures of
olive oil and various other substances were made which simulated
many of the phenomena of protoplasm in much the same way as
crystalline products may be made which simulate the growth of a
plant stem with its branches. For instance, one has only to shake up
a little soapy water in a flask to see what resembles surprisingly the
arrangement of certain kinds of connective tissues in the organism.
Obviously these artificial phenomena have nothing to do with living
substance.
Yet if we grind up a living muscle with some sand in a mortar we do
destroy something. The muscle could be made to contract, but after
disintegration this power is lost. We have certainly destroyed a
structure, or mechanism, of some kind. But, again, the paste of
muscle substance and sand still possesses some kind of vital activity,
for with certain precautions it can be made to exhibit many of the
phenomena of enzyme activity displayed by the intact muscle fibres,
or even the entire organism. Mechanical disintegration, therefore,
abolishes some of the activities of the organism, but not all of them.
If, however, we heat the muscle paste above a certain temperature,
the residue of vital phenomena exhibited by it are irreversibly
removed, so that heating destroys the mechanism. This we can
hardly imagine to be the case (within ordinary limits of temperature
at least) with a physical mechanism, but again a mechanism which is
partly chemical might be so destroyed. We see, then, that
protoplasm possesses a mechanical structure, but that all of its vital
activities do not necessarily depend on this structure. The full
manifestation of these activities depends on the protoplasmic
substance possessing a certain volume or mass, and also on a
certain chemical structure.
If living protoplasm has a structure, and is not simply a mixture of
chemical compounds, what is it then? Two or three physico-chemical
concepts are at the present time very much in evidence in this
connection. When the substances known as colloids were fully
investigated by the chemists, much attention was paid to them by
the physiologists, so that life was called “the chemistry of the
colloids,” just as after the investigation of the enzymes it was called
the “chemistry of the enzymes,” and when the discovery of the
relative abundance of phosphorus in cell-nuclei and in the brain was
discovered, it was called the “chemistry of phosphorus.” Colloids
(e.g. glue) are substances that do not readily diffuse through certain
membranes, in opposition to crystalloids (e.g. solution of common
salt) which do readily so diffuse. They form solutions which easily
gelatinise reversibly, that is, can become liquid again (glue); or
coagulate irreversibly, that is, cannot become liquid again
(albumen); which have no definite saturation point; which have a
low osmotic pressure (and derived properties), etc.; and the
molecules of which are compound ones consisting of combinations
of the molecules of the substance with the molecules of the solvent,
or with each other, that is, they are molecular aggregates.
Colloids pass insensibly into crystalloids on the one hand and into
coarse suspensions (water shaken up with fine mud, for instance) on
the other. We may replace the concept of a colloid by those of
“suspensoids” and “emulsoids.” A suspensoid is a liquid containing
particles in a fine state of division—if the division is that into the
separate molecules we have a solution, if into large aggregates of
molecules we have a suspension. If the substance in the liquid is
itself liquid, the whole is called an emulsoid. On the one hand this
approaches to a mixture of oil in soap and water—an emulsion—and
on the other hand to such a mixture as chloroform shaken up with
water, when the drops of chloroform readily join together so that
two layers of liquid (chloroform and water) form. What we see, then,
in protoplasm is a viscid substance possessing a structure of some
kind, and containing specialised protoplasmic bodies in its mass
(nuclei, nucleoli, granules of various kinds, chlorophyll, and other
plastids, etc.). It may contain or exhibit suspensoid or emulsoid parts
or substances, or it may contain truly crystalloid solutions. These
phases of its constituents are not fixed, but pass into each other
during its activity. Nothing that we know about it justifies us in
speaking about a “living chemical substance.” On analysis we find
that it is a mixture of true chemical substances rather than a
substance. It is no use saying that in order to analyse it we must kill
it, for what we can observe in it without destroying its structure or
activities indicates that it is chemically heterogeneous.
This is not a textbook of general physiology, and the examples of
physico-chemical reactions in the organism which we have selected
have been quoted in order to show to what extent the chemical and
physical methods applied by the physiologists have succeeded in
resolving the activities of the organism. The question for our
consideration is this: do these results of physico-chemical analysis
fully describe organic functioning? Dogmatic mechanism says “yes”
without equivocation.
Now it is clear, from even the few typical examples that we have
quoted, that physiological analysis shows, indeed, a resolution of the
activities of the organism into chemical and physical reactions. How
could it do otherwise? How could chemical and physical methods of