Вы находитесь на странице: 1из 51

Using And Administering Linux:

Volume 1 Zero To SysAdmin: Getting


Started 2nd Edition David Both
Visit to download the full and correct content document:
https://ebookmass.com/product/using-and-administering-linux-volume-1-zero-to-sysa
dmin-getting-started-2nd-edition-david-both/
Using and Administering
Linux: Volume 1
Zero to SysAdmin: Getting Started
Second Edition

David Both
Using and Administering Linux: Volume 1: Zero to SysAdmin: Getting Started
David Both
Raleigh, NC, USA

ISBN-13 (pbk): 978-1-4842-9617-2 ISBN-13 (electronic): 978-1-4842-9618-9


https://doi.org/10.1007/978-1-4842-9618-9

Copyright © 2023 by David Both


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.
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 authors 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, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: James Robinson-Prior
Development Editor: Jim Markham
Editorial Assistant: Gryffin Winkler
Cover image designed by the author
Distributed to the book trade worldwide by Springer Science+Business Media New York, 1 New York Plaza,
1 FDR Dr, New York, NY 10004. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-
sbm.com, or visit www.springeronline.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 booktranslations@springernature.com; for reprint,
paperback, or audio rights, please e-mail bookpermissions@springernature.com.
Apress titles 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 Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to readers
on GitHub (https://github.com/Apress). For more detailed information, please visit https://www.apress.com/
gp/services/source-code.
Paper in this product is recyclable
This book is dedicated to all
Linux and open source developers, system administrators,
course developers, and trainers.
:(){ :|:& };:
Table of Contents
About the Author����������������������������������������������������������������������������������������������������xxi

About the Technical Reviewers����������������������������������������������������������������������������xxiii


Acknowledgments�������������������������������������������������������������������������������������������������xxv

Introduction���������������������������������������������������������������������������������������������������������xxvii

Chapter 1: Introduction�������������������������������������������������������������������������������������������� 1
Objectives������������������������������������������������������������������������������������������������������������������������������������� 1
About Linux����������������������������������������������������������������������������������������������������������������������������������� 1
The Birth of Windows�������������������������������������������������������������������������������������������������������������������� 3
Black Box Syndrome��������������������������������������������������������������������������������������������������������������� 3
The Birth of Linux�������������������������������������������������������������������������������������������������������������������������� 5
The Open Box�������������������������������������������������������������������������������������������������������������������������������� 6
The Linux Truth������������������������������������������������������������������������������������������������������������������������������ 7
Knowledge������������������������������������������������������������������������������������������������������������������������������������ 8
Flexibility��������������������������������������������������������������������������������������������������������������������������������������� 9
Stability��������������������������������������������������������������������������������������������������������������������������������������� 10
Scalability����������������������������������������������������������������������������������������������������������������������������������� 11
Security��������������������������������������������������������������������������������������������������������������������������������������� 12
Freedom�������������������������������������������������������������������������������������������������������������������������������������� 12
Our Software Rights�������������������������������������������������������������������������������������������������������������� 13
Longevity������������������������������������������������������������������������������������������������������������������������������������� 14
Data��������������������������������������������������������������������������������������������������������������������������������������� 16
Resist Malware��������������������������������������������������������������������������������������������������������������������������� 16
Should I Be a SysAdmin?������������������������������������������������������������������������������������������������������������ 17
About This Course����������������������������������������������������������������������������������������������������������������������� 19

v
Table of Contents

About the Experiments���������������������������������������������������������������������������������������������������������������� 20


What to Do If the Experiments Do Not Work�������������������������������������������������������������������������������� 22
Terminology�������������������������������������������������������������������������������������������������������������������������������� 23
How to Access the Command Line���������������������������������������������������������������������������������������������� 23
Chapter Summary����������������������������������������������������������������������������������������������������������������������� 24
Exercises������������������������������������������������������������������������������������������������������������������������������������� 24

Chapter 2: Introduction to Operating Systems������������������������������������������������������� 27


Objectives����������������������������������������������������������������������������������������������������������������������������������� 27
Choice – Really!�������������������������������������������������������������������������������������������������������������������������� 27
What Is an Operating System?���������������������������������������������������������������������������������������������������� 28
Hardware������������������������������������������������������������������������������������������������������������������������������������ 29
Motherboard�������������������������������������������������������������������������������������������������������������������������� 29
The Processor������������������������������������������������������������������������������������������������������������������������ 30
Peripherals���������������������������������������������������������������������������������������������������������������������������� 34
The Operating System����������������������������������������������������������������������������������������������������������������� 34
The Definition������������������������������������������������������������������������������������������������������������������������ 35
Typical Operating System Functions������������������������������������������������������������������������������������������� 36
Memory Management����������������������������������������������������������������������������������������������������������� 36
Multitasking��������������������������������������������������������������������������������������������������������������������������� 37
Multiuser������������������������������������������������������������������������������������������������������������������������������� 38
Process Management������������������������������������������������������������������������������������������������������������ 38
Interprocess Communication������������������������������������������������������������������������������������������������� 39
Device Management�������������������������������������������������������������������������������������������������������������� 40
Error Handling����������������������������������������������������������������������������������������������������������������������� 40
Utilities���������������������������������������������������������������������������������������������������������������������������������������� 41
A Bit of History���������������������������������������������������������������������������������������������������������������������������� 41
Starting with UNICS��������������������������������������������������������������������������������������������������������������� 42
UNIX��������������������������������������������������������������������������������������������������������������������������������������� 43
The Berkeley Software Distribution (BSD)����������������������������������������������������������������������������� 44
The Unix Philosophy�������������������������������������������������������������������������������������������������������������� 44

vi
Table of Contents

A (Very) Brief History of Linux����������������������������������������������������������������������������������������������������� 46


Core Utilities�������������������������������������������������������������������������������������������������������������������������������� 46
GNU Coreutils������������������������������������������������������������������������������������������������������������������������ 47
util-linux�������������������������������������������������������������������������������������������������������������������������������� 48
Copyleft��������������������������������������������������������������������������������������������������������������������������������� 49
Games����������������������������������������������������������������������������������������������������������������������������������������� 49
Chapter Summary����������������������������������������������������������������������������������������������������������������������� 50
Exercises������������������������������������������������������������������������������������������������������������������������������������� 50

Chapter 3: The Linux Philosophy for SysAdmins���������������������������������������������������� 51


Objectives����������������������������������������������������������������������������������������������������������������������������������� 51
Background��������������������������������������������������������������������������������������������������������������������������������� 51
The Structure of the Philosophy�������������������������������������������������������������������������������������������������� 52
The Tenets����������������������������������������������������������������������������������������������������������������������������������� 54
Data Streams Are a Universal Interface��������������������������������������������������������������������������������� 54
Transforming Data Streams��������������������������������������������������������������������������������������������������� 55
Everything Is a File���������������������������������������������������������������������������������������������������������������� 56
Use the Linux FHS����������������������������������������������������������������������������������������������������������������� 57
Embrace the CLI�������������������������������������������������������������������������������������������������������������������� 57
Be the Lazy SysAdmin����������������������������������������������������������������������������������������������������������� 58
Automate Everything������������������������������������������������������������������������������������������������������������� 58
Always Use Shell Scripts������������������������������������������������������������������������������������������������������� 59
Test Early and Test Often������������������������������������������������������������������������������������������������������� 60
Use Commonsense Naming��������������������������������������������������������������������������������������������������� 61
Store Data in Open Formats�������������������������������������������������������������������������������������������������� 62
Use Separate Filesystems for Data��������������������������������������������������������������������������������������� 62
Make Programs Portable������������������������������������������������������������������������������������������������������� 63
Use Open Source Software���������������������������������������������������������������������������������������������������� 64
Strive for Elegance���������������������������������������������������������������������������������������������������������������� 65
Find the Simplicity����������������������������������������������������������������������������������������������������������������� 66
Use Your Favorite Editor�������������������������������������������������������������������������������������������������������� 67

vii
Table of Contents

Document Everything������������������������������������������������������������������������������������������������������������ 68
Backup Everything – Frequently������������������������������������������������������������������������������������������� 69
Follow Your Curiosity������������������������������������������������������������������������������������������������������������� 70
There Is No “Should”������������������������������������������������������������������������������������������������������������� 70
Mentor the Young SysAdmins������������������������������������������������������������������������������������������������ 71
Support Your Favorite Open Source Project�������������������������������������������������������������������������� 72
Reality Bytes�������������������������������������������������������������������������������������������������������������������������� 72
Chapter Summary����������������������������������������������������������������������������������������������������������������������� 73
Exercises������������������������������������������������������������������������������������������������������������������������������������� 73

Chapter 4: Preparation������������������������������������������������������������������������������������������� 75
Objectives����������������������������������������������������������������������������������������������������������������������������������� 75
Overview������������������������������������������������������������������������������������������������������������������������������������� 75
Got Root?������������������������������������������������������������������������������������������������������������������������������������ 76
Hardware Specifications������������������������������������������������������������������������������������������������������������� 77
Host Software Requirements������������������������������������������������������������������������������������������������������ 78
Installing VirtualBox�������������������������������������������������������������������������������������������������������������������� 79
Install VirtualBox on a Linux Host������������������������������������������������������������������������������������������ 79
Install VirtualBox on a Windows Host������������������������������������������������������������������������������������ 87
Creating the VM��������������������������������������������������������������������������������������������������������������������������� 90
VirtualBox Manager��������������������������������������������������������������������������������������������������������������� 91
Configuring the Virtual Network�������������������������������������������������������������������������������������������� 93
Preparing Disk Space������������������������������������������������������������������������������������������������������������ 95
Download the ISO Image File���������������������������������������������������������������������������������������������� 110
Creating the VM������������������������������������������������������������������������������������������������������������������� 112
Chapter Summary��������������������������������������������������������������������������������������������������������������������� 121
Exercises����������������������������������������������������������������������������������������������������������������������������������� 121

viii
Table of Contents

Chapter 5: Installing Linux����������������������������������������������������������������������������������� 123


Objectives��������������������������������������������������������������������������������������������������������������������������������� 123
Overview����������������������������������������������������������������������������������������������������������������������������������� 123
Insert the Fedora Live Image���������������������������������������������������������������������������������������������������� 124
Boot the Live Image������������������������������������������������������������������������������������������������������������������ 127
Installing Fedora����������������������������������������������������������������������������������������������������������������������� 130
Start the Installation������������������������������������������������������������������������������������������������������������ 130
Set the Host Name��������������������������������������������������������������������������������������������������������������� 131
User Accounts���������������������������������������������������������������������������������������������������������������������� 133
Hard Drive Partitioning�������������������������������������������������������������������������������������������������������� 136
About Swap Space�������������������������������������������������������������������������������������������������������������� 149
Finish Partitioning��������������������������������������������������������������������������������������������������������������� 149
Begin the Installation���������������������������������������������������������������������������������������������������������������� 149
Finish the Installation���������������������������������������������������������������������������������������������������������������� 150
Shut Down the Live System������������������������������������������������������������������������������������������������� 151
Reconfigure the VM������������������������������������������������������������������������������������������������������������� 153
Create a Snapshot��������������������������������������������������������������������������������������������������������������� 153
First Boot����������������������������������������������������������������������������������������������������������������������������������� 155
What to Do If the Experiments Do Not Work������������������������������������������������������������������������������ 158
Chapter Summary��������������������������������������������������������������������������������������������������������������������� 159
Exercises����������������������������������������������������������������������������������������������������������������������������������� 159

Chapter 6: Using the Xfce Desktop����������������������������������������������������������������������� 161


Objectives��������������������������������������������������������������������������������������������������������������������������������� 161
Why Xfce����������������������������������������������������������������������������������������������������������������������������������� 161
The Desktop������������������������������������������������������������������������������������������������������������������������� 162
The File Manager����������������������������������������������������������������������������������������������������������������� 164
Stability������������������������������������������������������������������������������������������������������������������������������� 164
Xfce4 Terminal Emulator����������������������������������������������������������������������������������������������������� 164
Configurability��������������������������������������������������������������������������������������������������������������������� 165
Getting Started�������������������������������������������������������������������������������������������������������������������������� 165

ix
Table of Contents

Login����������������������������������������������������������������������������������������������������������������������������������������� 167
First Look���������������������������������������������������������������������������������������������������������������������������������� 167
Exploring the Xfce Desktop������������������������������������������������������������������������������������������������������� 169
Screensaver������������������������������������������������������������������������������������������������������������������������� 169
Settings Manager���������������������������������������������������������������������������������������������������������������� 172
Adding Launchers to Panel 2����������������������������������������������������������������������������������������������� 173
Default Applications������������������������������������������������������������������������������������������������������������� 175
Desktop Appearance����������������������������������������������������������������������������������������������������������������� 178
Appearance������������������������������������������������������������������������������������������������������������������������� 178
Multiple Desktops��������������������������������������������������������������������������������������������������������������������� 183
Installing Updates��������������������������������������������������������������������������������������������������������������������� 186
Chapter Summary��������������������������������������������������������������������������������������������������������������������� 189
Exercises����������������������������������������������������������������������������������������������������������������������������������� 190

Chapter 7: Using the Linux Command Line����������������������������������������������������������� 191


Objectives��������������������������������������������������������������������������������������������������������������������������������� 191
Introduction������������������������������������������������������������������������������������������������������������������������������� 191
Preparation������������������������������������������������������������������������������������������������������������������������������� 192
Defining the Command Line������������������������������������������������������������������������������������������������������ 193
CLI Terminology������������������������������������������������������������������������������������������������������������������������� 194
Command Prompt���������������������������������������������������������������������������������������������������������������� 194
Command Line��������������������������������������������������������������������������������������������������������������������� 194
Command-Line Interface����������������������������������������������������������������������������������������������������� 195
Command���������������������������������������������������������������������������������������������������������������������������� 195
Terminal������������������������������������������������������������������������������������������������������������������������������� 196
Console�������������������������������������������������������������������������������������������������������������������������������� 197
Virtual Consoles������������������������������������������������������������������������������������������������������������������� 199
Terminal Emulator��������������������������������������������������������������������������������������������������������������� 206
Pseudo-terminal������������������������������������������������������������������������������������������������������������������ 207
Session�������������������������������������������������������������������������������������������������������������������������������� 208
Shell������������������������������������������������������������������������������������������������������������������������������������ 209

x
Table of Contents

Secure Shell (SSH)�������������������������������������������������������������������������������������������������������������� 212


Screen��������������������������������������������������������������������������������������������������������������������������������� 213
The GUI and the CLI������������������������������������������������������������������������������������������������������������������� 215
Some Important Linux Commands�������������������������������������������������������������������������������������������� 216
The PWD������������������������������������������������������������������������������������������������������������������������������ 217
Directory Path Notation Styles��������������������������������������������������������������������������������������������� 217
Moving Around the Directory Tree��������������������������������������������������������������������������������������� 218
Tab Completion Facility������������������������������������������������������������������������������������������������������� 223
Exploring Files��������������������������������������������������������������������������������������������������������������������� 225
More Commands����������������������������������������������������������������������������������������������������������������� 228
Command Recall and Editing���������������������������������������������������������������������������������������������������� 230
Chapter Summary��������������������������������������������������������������������������������������������������������������������� 233
Exercises����������������������������������������������������������������������������������������������������������������������������������� 233

Chapter 8: Core Utilities���������������������������������������������������������������������������������������� 235


Objectives��������������������������������������������������������������������������������������������������������������������������������� 235
GNU Coreutils���������������������������������������������������������������������������������������������������������������������������� 235
util-linux������������������������������������������������������������������������������������������������������������������������������������ 240
Chapter Summary��������������������������������������������������������������������������������������������������������������������� 245
Exercises����������������������������������������������������������������������������������������������������������������������������������� 245

Chapter 9: Data Streams�������������������������������������������������������������������������������������� 247


Objectives��������������������������������������������������������������������������������������������������������������������������������� 247
Data Streams as Raw Materials������������������������������������������������������������������������������������������������ 247
Text Streams: A Universal Interface������������������������������������������������������������������������������������������ 249
STDIO File Handles�������������������������������������������������������������������������������������������������������������������� 249
Preparing a Logical Volume for Testing������������������������������������������������������������������������������������� 250
Storage Device Logical Structure���������������������������������������������������������������������������������������� 250
Creating the New Volume���������������������������������������������������������������������������������������������������� 251
Generating Data Streams���������������������������������������������������������������������������������������������������������� 256
Test a Theory with Yes�������������������������������������������������������������������������������������������������������������� 259
The Boot Record������������������������������������������������������������������������������������������������������������������������ 264

xi
Table of Contents

Digging Deeper������������������������������������������������������������������������������������������������������������������������� 267


Randomness����������������������������������������������������������������������������������������������������������������������������� 269
Pipe Dreams������������������������������������������������������������������������������������������������������������������������������ 270
Building Pipelines��������������������������������������������������������������������������������������������������������������������� 272
Redirection�������������������������������������������������������������������������������������������������������������������������������� 273
Just grepping Around���������������������������������������������������������������������������������������������������������������� 276
Chapter Summary��������������������������������������������������������������������������������������������������������������������� 277
Exercises����������������������������������������������������������������������������������������������������������������������������������� 278

Chapter 10: Text Editors��������������������������������������������������������������������������������������� 279


Objectives��������������������������������������������������������������������������������������������������������������������������������� 279
Why We Need Text Editors��������������������������������������������������������������������������������������������������������� 279
Vim�������������������������������������������������������������������������������������������������������������������������������������������� 281
Other Editors����������������������������������������������������������������������������������������������������������������������������� 282
Nano������������������������������������������������������������������������������������������������������������������������������������ 282
Emacs���������������������������������������������������������������������������������������������������������������������������������� 283
gnome-text-editor��������������������������������������������������������������������������������������������������������������� 283
gedit������������������������������������������������������������������������������������������������������������������������������������ 283
Leafpad�������������������������������������������������������������������������������������������������������������������������������� 284
Kate������������������������������������������������������������������������������������������������������������������������������������� 284
xfw��������������������������������������������������������������������������������������������������������������������������������������� 284
xed��������������������������������������������������������������������������������������������������������������������������������������� 284
Learning Nano��������������������������������������������������������������������������������������������������������������������������� 285
Learning Vim����������������������������������������������������������������������������������������������������������������������������� 287
Setting SELinux to Permissive��������������������������������������������������������������������������������������������� 288
Use Your Favorite Text Editor����������������������������������������������������������������������������������������������������� 289
Chapter Summary��������������������������������������������������������������������������������������������������������������������� 290
Exercises����������������������������������������������������������������������������������������������������������������������������������� 291

xii
Table of Contents

Chapter 11: Working as Root�������������������������������������������������������������������������������� 293


Objectives��������������������������������������������������������������������������������������������������������������������������������� 293
Why Root?��������������������������������������������������������������������������������������������������������������������������������� 293
More About the su Command���������������������������������������������������������������������������������������������������� 294
Getting to Know the Root Account�������������������������������������������������������������������������������������������� 296
Disadvantages of Root�������������������������������������������������������������������������������������������������������������� 302
Escalating User Privilege���������������������������������������������������������������������������������������������������������� 302
The Bad Ways���������������������������������������������������������������������������������������������������������������������� 303
Using sudo��������������������������������������������������������������������������������������������������������������������������� 303
The sudoers File������������������������������������������������������������������������������������������������������������������ 308
Real SysAdmins Don’t sudo������������������������������������������������������������������������������������������������������ 311
sudo or Not sudo����������������������������������������������������������������������������������������������������������������� 312
Valid Uses for sudo�������������������������������������������������������������������������������������������������������������� 313
Using su as Root����������������������������������������������������������������������������������������������������������������������� 314
Chapter Summary��������������������������������������������������������������������������������������������������������������������� 315
Exercises����������������������������������������������������������������������������������������������������������������������������������� 315

Chapter 12: Installing and Updating Software������������������������������������������������������ 317


Objectives��������������������������������������������������������������������������������������������������������������������������������� 317
Dependency Hell����������������������������������������������������������������������������������������������������������������������� 317
RPM������������������������������������������������������������������������������������������������������������������������������������������� 318
YUM������������������������������������������������������������������������������������������������������������������������������������������� 323
DNF������������������������������������������������������������������������������������������������������������������������������������������� 324
Installing Packages������������������������������������������������������������������������������������������������������������� 325
Installing Updates���������������������������������������������������������������������������������������������������������������� 328
Post-update Tasks��������������������������������������������������������������������������������������������������������������� 331
Removing Packages������������������������������������������������������������������������������������������������������������ 332
Groups��������������������������������������������������������������������������������������������������������������������������������������� 334
Adding Repositories������������������������������������������������������������������������������������������������������������������ 335

xiii
Table of Contents

Other Software�������������������������������������������������������������������������������������������������������������������������� 338


Installing Zoom�������������������������������������������������������������������������������������������������������������������� 338
Updating Zoom�������������������������������������������������������������������������������������������������������������������� 339
About the Kernel����������������������������������������������������������������������������������������������������������������������� 340
Chapter Summary��������������������������������������������������������������������������������������������������������������������� 343
Exercises����������������������������������������������������������������������������������������������������������������������������������� 343

Chapter 13: Tools for Problem Solving����������������������������������������������������������������� 345


Objectives��������������������������������������������������������������������������������������������������������������������������������� 345
The Art of Problem Solving������������������������������������������������������������������������������������������������������� 346
The Five Steps of Problem Solving�������������������������������������������������������������������������������������� 346
Knowledge��������������������������������������������������������������������������������������������������������������������������� 347
Observation������������������������������������������������������������������������������������������������������������������������� 348
Reasoning���������������������������������������������������������������������������������������������������������������������������� 349
Action���������������������������������������������������������������������������������������������������������������������������������� 349
Test�������������������������������������������������������������������������������������������������������������������������������������� 350
System Performance and Problem Solving������������������������������������������������������������������������������� 350
top��������������������������������������������������������������������������������������������������������������������������������������� 351
Other top-Like Tools������������������������������������������������������������������������������������������������������������������ 367
htop������������������������������������������������������������������������������������������������������������������������������������� 368
atop������������������������������������������������������������������������������������������������������������������������������������� 370
More Tools��������������������������������������������������������������������������������������������������������������������������������� 372
Memory Tools���������������������������������������������������������������������������������������������������������������������� 372
The /proc Filesystem����������������������������������������������������������������������������������������������������������������� 377
Exploring Hardware������������������������������������������������������������������������������������������������������������������� 380
Monitoring Hardware Temperatures����������������������������������������������������������������������������������������� 382
Monitoring Storage Drives��������������������������������������������������������������������������������������������������� 385
System Statistics with SAR������������������������������������������������������������������������������������������������������� 395
Installation and Configuration��������������������������������������������������������������������������������������������� 395
Examining Collected Data���������������������������������������������������������������������������������������������������� 396

xiv
Table of Contents

Cleanup������������������������������������������������������������������������������������������������������������������������������������� 400
Chapter Summary��������������������������������������������������������������������������������������������������������������������� 401
Exercises����������������������������������������������������������������������������������������������������������������������������������� 402

Chapter 14: Terminal Emulator Mania������������������������������������������������������������������ 405


Objectives��������������������������������������������������������������������������������������������������������������������������������� 405
About Terminals������������������������������������������������������������������������������������������������������������������������ 405
My Requirements���������������������������������������������������������������������������������������������������������������������� 406
The Terminal Emulators������������������������������������������������������������������������������������������������������������ 407
rxvt�������������������������������������������������������������������������������������������������������������������������������������� 408
xfce4-terminal��������������������������������������������������������������������������������������������������������������������� 409
LXTerminal��������������������������������������������������������������������������������������������������������������������������� 413
Tilix�������������������������������������������������������������������������������������������������������������������������������������� 415
Konsole�������������������������������������������������������������������������������������������������������������������������������� 421
Terminator��������������������������������������������������������������������������������������������������������������������������� 423
Chapter Summary��������������������������������������������������������������������������������������������������������������������� 426
Exercises����������������������������������������������������������������������������������������������������������������������������������� 427

Chapter 15: Advanced Shell Topics���������������������������������������������������������������������� 429


Objectives��������������������������������������������������������������������������������������������������������������������������������� 429
The Bash Shell�������������������������������������������������������������������������������������������������������������������������� 430
Shell Options����������������������������������������������������������������������������������������������������������������������������� 430
Shell Variables�������������������������������������������������������������������������������������������������������������������������� 432
Commands�������������������������������������������������������������������������������������������������������������������������������� 433
The PATH����������������������������������������������������������������������������������������������������������������������������� 434
Internal Commands������������������������������������������������������������������������������������������������������������� 437
External Commands������������������������������������������������������������������������������������������������������������ 439
Forcing the Use of External Commands������������������������������������������������������������������������������ 440
Command-Line Programs��������������������������������������������������������������������������������������������������������� 440
Time-Saving Tools��������������������������������������������������������������������������������������������������������������������� 445
Brace Expansion������������������������������������������������������������������������������������������������������������������ 446
Special Pattern Characters�������������������������������������������������������������������������������������������������� 448

xv
Table of Contents

Sets������������������������������������������������������������������������������������������������������������������������������������� 451
Meta-characters������������������������������������������������������������������������������������������������������������������ 452
Using grep��������������������������������������������������������������������������������������������������������������������������������� 453
Finding Files������������������������������������������������������������������������������������������������������������������������������ 458
Chapter Summary��������������������������������������������������������������������������������������������������������������������� 461
Exercises����������������������������������������������������������������������������������������������������������������������������������� 462

Chapter 16: Linux Boot and Startup��������������������������������������������������������������������� 463


Objectives��������������������������������������������������������������������������������������������������������������������������������� 463
Overview����������������������������������������������������������������������������������������������������������������������������������� 464
Hardware Boot�������������������������������������������������������������������������������������������������������������������������� 464
The Boot Sector������������������������������������������������������������������������������������������������������������������������ 465
The MBR������������������������������������������������������������������������������������������������������������������������������ 466
The GPT������������������������������������������������������������������������������������������������������������������������������� 466
Impact��������������������������������������������������������������������������������������������������������������������������������� 466
Linux Boot��������������������������������������������������������������������������������������������������������������������������������� 467
GRUB����������������������������������������������������������������������������������������������������������������������������������� 467
Configuring GRUB���������������������������������������������������������������������������������������������������������������� 478
Finishing GRUB Boot������������������������������������������������������������������������������������������������������������ 480
The Linux Kernel����������������������������������������������������������������������������������������������������������������������� 481
Linux Startup����������������������������������������������������������������������������������������������������������������������������� 481
Text-Mode Startup��������������������������������������������������������������������������������������������������������������� 481
systemd������������������������������������������������������������������������������������������������������������������������������� 484
Graphical Login Screen������������������������������������������������������������������������������������������������������������� 492
Display Manager������������������������������������������������������������������������������������������������������������������ 493
Window Manager����������������������������������������������������������������������������������������������������������������� 494
How Do I Deal with All These Choices?������������������������������������������������������������������������������� 496
Recovery Mode������������������������������������������������������������������������������������������������������������������������� 502
When Booting to Rescue Mode Fails����������������������������������������������������������������������������������� 504
Working in Rescue Mode����������������������������������������������������������������������������������������������������� 505

xvi
Table of Contents

About the Login������������������������������������������������������������������������������������������������������������������������� 508


CLI Login Screen������������������������������������������������������������������������������������������������������������������ 508
GUI Login Screen����������������������������������������������������������������������������������������������������������������� 509
Chapter Summary��������������������������������������������������������������������������������������������������������������������� 510
Exercises����������������������������������������������������������������������������������������������������������������������������������� 510

Chapter 17: Shell Configuration���������������������������������������������������������������������������� 513


Objectives��������������������������������������������������������������������������������������������������������������������������������� 513
Starting the Shell���������������������������������������������������������������������������������������������������������������������� 514
Non-login Shell Startup������������������������������������������������������������������������������������������������������� 517
Login Shell Startup�������������������������������������������������������������������������������������������������������������� 517
Exploring the Global Configuration Scripts�������������������������������������������������������������������������� 518
Exploring the Local Configuration Scripts��������������������������������������������������������������������������� 521
Testing It������������������������������������������������������������������������������������������������������������������������������ 522
Exploring the Environment�������������������������������������������������������������������������������������������������������� 526
User Shell Variables������������������������������������������������������������������������������������������������������������� 527
Aliases�������������������������������������������������������������������������������������������������������������������������������������� 529
Chapter Summary��������������������������������������������������������������������������������������������������������������������� 531
Exercises����������������������������������������������������������������������������������������������������������������������������������� 532

Chapter 18: Files, Directories, and Links�������������������������������������������������������������� 535


Objectives��������������������������������������������������������������������������������������������������������������������������������� 535
Introduction������������������������������������������������������������������������������������������������������������������������������� 536
Preparation������������������������������������������������������������������������������������������������������������������������������� 536
User Accounts and Security������������������������������������������������������������������������������������������������������ 538
File Attributes���������������������������������������������������������������������������������������������������������������������������� 538
File Ownership��������������������������������������������������������������������������������������������������������������������� 538
File Permissions������������������������������������������������������������������������������������������������������������������ 542
Directory Permissions��������������������������������������������������������������������������������������������������������� 544
Implications of Group Ownership���������������������������������������������������������������������������������������� 544
umask���������������������������������������������������������������������������������������������������������������������������������� 549
Changing File Permissions�������������������������������������������������������������������������������������������������� 551

xvii
Table of Contents

Applying Permissions���������������������������������������������������������������������������������������������������������� 553


Timestamps������������������������������������������������������������������������������������������������������������������������� 554
File Meta-structures����������������������������������������������������������������������������������������������������������������� 555
The Directory Entry�������������������������������������������������������������������������������������������������������������� 555
The inode����������������������������������������������������������������������������������������������������������������������������� 555
File Information������������������������������������������������������������������������������������������������������������������������� 555
Links����������������������������������������������������������������������������������������������������������������������������������������� 558
Hard Links��������������������������������������������������������������������������������������������������������������������������� 559
Chapter Summary��������������������������������������������������������������������������������������������������������������������� 568
Exercises����������������������������������������������������������������������������������������������������������������������������������� 568

Chapter 19: Filesystems��������������������������������������������������������������������������������������� 571


Objectives��������������������������������������������������������������������������������������������������������������������������������� 571
Overview����������������������������������������������������������������������������������������������������������������������������������� 571
Definitions��������������������������������������������������������������������������������������������������������������������������������� 572
Filesystem��������������������������������������������������������������������������������������������������������������������������� 572
Storage�������������������������������������������������������������������������������������������������������������������������������� 573
Filesystem Functions���������������������������������������������������������������������������������������������������������������� 573
The Linux Filesystem Hierarchical Standard����������������������������������������������������������������������������� 575
The Standard����������������������������������������������������������������������������������������������������������������������� 576
Problem Solving������������������������������������������������������������������������������������������������������������������ 579
Using the Filesystem Incorrectly����������������������������������������������������������������������������������������� 579
Adhering to the Standard���������������������������������������������������������������������������������������������������� 580
Linux Unified Directory Structure���������������������������������������������������������������������������������������������� 580
Filesystem Types����������������������������������������������������������������������������������������������������������������������� 582
Mounting����������������������������������������������������������������������������������������������������������������������������������� 583
The Linux EXT4 Filesystem������������������������������������������������������������������������������������������������������� 584
Cylinder Groups������������������������������������������������������������������������������������������������������������������� 585
The inode����������������������������������������������������������������������������������������������������������������������������� 591
Journal�������������������������������������������������������������������������������������������������������������������������������� 592

xviii
Table of Contents

Data Allocation Strategies��������������������������������������������������������������������������������������������������������� 594


Data Fragmentation������������������������������������������������������������������������������������������������������������� 595
Repairing Problems������������������������������������������������������������������������������������������������������������������� 600
The /etc/fstab File��������������������������������������������������������������������������������������������������������������� 600
Repairing Damaged Filesystems���������������������������������������������������������������������������������������������� 608
Using a Fedora Live USB Device for System Recovery�������������������������������������������������������� 609
Finding Lost Files���������������������������������������������������������������������������������������������������������������� 611
Creating a New Filesystem������������������������������������������������������������������������������������������������������� 612
Finding Space���������������������������������������������������������������������������������������������������������������������� 612
Add a New Virtual Hard Drive���������������������������������������������������������������������������������������������� 614
Other Filesystems��������������������������������������������������������������������������������������������������������������������� 623
Chapter Summary��������������������������������������������������������������������������������������������������������������������� 625
Exercises����������������������������������������������������������������������������������������������������������������������������������� 625

Index��������������������������������������������������������������������������������������������������������������������� 627

xix
About the Author
David Both is an open source software and GNU/Linux
advocate, trainer, writer, and speaker. He has been working
with Linux and open source software for more than 25 years
and has been working with computers for over 50 years.
He is a strong proponent of and evangelist for the “Linux
Philosophy for system administrators.”
He worked for IBM for 21 years and, while working as
a course development representative in Boca Raton, FL, in
1981, wrote the training course for the first IBM PC. He has
taught RHCE classes for Red Hat and has taught classes on
Linux ranging from Lunch’n’Learns to full five-day courses.
David’s books and articles are a continuation of his desire to pass on his knowledge
and to provide mentoring to anyone interested in learning about Linux.
David prefers to purchase the components and build his own computers from
scratch to ensure that each new computer meets his exacting specifications. Building
his own computers also means not having to pay the Microsoft tax. His latest build is an
ASUS TUF X299 motherboard and an Intel i9 CPU with 16 cores (32 CPUs) and 64GB of
RAM in a Cooler Master MasterFrame 700.
David is the author of The Linux Philosophy for SysAdmins (Apress, 2018) and
co-author of Linux for Small Business Owners (Apress, 2022) and can be found on
Mastodon @linuxgeek46@LinuxRocks.online.

xxi
About the Technical Reviewers
Branton Brodie started his Linux journey last year while
attending All Things Open 2022. Getting into the IT world
was something he wanted to do for a while but didn’t
know where to start until he went there and saw all the
opportunities shown. Linux stood out to him the most,
and he is now studying to become a SysAdmin. He enjoys
reading about tech and how the future of tech will shape
the world around us. He lives in the calming town of Wake
Forest, NC.

Seth Kenlon is a Unix and Linux geek, SysAdmin, open


source and free culture advocate, music producer, Java and
Lua programmer, game designer, and tabletop gamer. He
arrived in the computer industry by way of film production.

xxiii
Acknowledgments
Writing a book – and especially a three-volume second edition – is not a solitary activity,
and this massive Linux training course required a team effort much more so than most.
The most important person in this effort has been my awesome wife, Alice, who
has been my head cheerleader and best friend throughout. I could not have done this
without your support and love. Again!
I owe many thanks to my editors at Apress, James Robinson-Prior, Jim Markham,
and Gryffin Winkler, for seeing the need for a second edition and especially for being
supportive as I worked my way through some major restructuring and a significant
amount of new material. I especially thank you for your immediate support when I
suggested having a student as second technical editor.
Seth Kenlon, my amazing technical reviewer, and I have worked together before on
previous books as well as many of the articles I wrote for the now defunct Opensource.
com website. I am grateful for his contributions to the technical accuracy of all three
volumes of this course. Seth also made some important suggestions that improved
the flow and accuracy of this course. I once said that Seth was on the “ragged edge of
being brutally honest” in his editorial tasks; he responded that he had been aiming for
“completely brutal,” but had apparently failed. You still have my ongoing gratitude for the
work you do.
I also owe many thanks to Branton Brodie, my second technical editor for all three
volumes. Branton and I met as part of his desire to learn about Linux at a time when I
was just starting on this second edition. I thought that having a student who wanted to
take the course anyway act as a technical editor could provide me with some insight into
how students view the course. His contributions have been valuable to my work as I was
able to revise descriptions and explanations that made sense to me but not necessarily to
anyone who has never been exposed to Linux or system administration.
Of course any remaining errors, omissions, and poor explanations are my
responsibility alone.

xxv
Introduction
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.

The Process
The process that goes 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

xxvii
Introduction

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 a user. 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 did not 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

xxviii
Introduction

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.
xxix
Introduction

 sing and Administering Linux: Volume 1 – Zero to


U
SysAdmin: Getting Started
Chapters 1 through 3 of Volume 1 introduce operating systems in general and Linux in
particular and briefly explore the Linux Philosophy for SysAdmins 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.
Chapters 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, Chapters 18 and 19 dive into all things files and filesystems.

1. Introduction
2. Introduction to Operating Systems

3. The Linux Philosophy for SysAdmins

4. Preparation
5. Installing Linux

6. Using the Xfce Desktop

7. Using the Linux Command Line

xxx
Introduction

8. Core Utilities

9. Data Streams

10. Text Editors

11. Working As Root

12. Installing and Updating New Software

13. Tools for Problem Solving

14. Terminal Emulator Mania

15. Advanced Shell Topics

16. Linux Boot and Startup

17. Shell Configuration

18. Files, Directories, and Links

19. Filesystems

 sing and Administering Linux: Volume 2 – Zero to


U
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.

xxxi
Introduction

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 filesystem 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 39 explores the use of the traditional Linux log files.
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.

20. Logical Volume Management

21. File Managers

22. Everything Is a File

23. Managing Processes

24. Special Filesystems

25. Regular Expressions

26. Printing

27. Hardware Detection

28. Command-Line Programming

29. Automation with Bash Scripts


30. Automation with Ansible

31. Time and Automation

xxxii
Introduction

32. Networking

33. NetworkManager

34. The BTRFS Filesystem

35. systemd – Getting Started

36. Advanced systemd Functions

37. systemd Finale

38. Dbus and Udev

39. Traditional Logs

40. Managing Users

41. Managing the Firewall

 sing and Administering Linux: Volume 3 – Zero to


U
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 and 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 Domain Name Services (DNS) in detail both from client and
server standpoints. You’ll learn to use the /etc/hosts file for simple name resolution and
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.

xxxiii
Another random document with
no related content on Scribd:
The Project Gutenberg eBook of Stay off the
Moon!
This ebook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
ebook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.

Title: Stay off the Moon!

Author: Raymond F. Jones

Illustrator: Virgil Finlay

Release date: December 5, 2023 [eBook #72337]

Language: English

Original publication: New York, NY: Ziff-Davis Publishing Company,


1962

Credits: Greg Weeks, Mary Meehan and the Online Distributed


Proofreading Team at http://www.pgdp.net

*** START OF THE PROJECT GUTENBERG EBOOK STAY OFF


THE MOON! ***
Stay off the MOON!

By RAYMOND F. JONES

Illustrated by FINLAY

How do you fill a pipette and measure out


a half c.c. of hydrochloric acid into a test
tube—from a quarter million miles away?

[Transcriber's Note: This etext was produced from


Amazing Stories December 1962.
Extensive research did not uncover any evidence that
the U.S. copyright on this publication was renewed.]
The real problem, of course, is not quite that simple. You don't literally
fill a pipette or use a test tube; you activate metering circuits that
force tiny, ground-glass plungers a measured distance into reagent
pumps. You send signals that close some valves and open others,
and apply heat and adjust temperatures, and filter solutions, and
send the product to a spectrometer that determines what you've got
and how much.
Then you have to code it and get the information from the moon to
earth.
James Cochran had seen the equipment work through hundreds of
checkout analyses. But he didn't understand it. He was a chemist,
and he had drawn up the specifications for the chemical analyzers of
the Prospector, but it had been the electronic boys who dreamed up
the remote mechanization and the telemetry equipment that would
allow him to sit before a complex panel at the Center and direct his
chemical laboratory on the moon to learn what the moon was made
of. Some of the light-headed technicians who worked on the project
had dubbed it Operation Green Cheese, but Cochran had more
respect for the complexity of the effort.
It was Sunday midnight. The beginning of countdown was forty hours
away. Cochran's crew had finished the chemical checkout, but in the
assembly hangar technicians still swarmed about the Prospector,
giving final-check to the power and telemetry components.
Jim Cochran signed off the last of the check reports and dropped
them in the slot for delivery to the Project Director. He turned off the
lights over his own desk and went out to the hangar. Under the blaze
of fluorescent lights the device looked like some monstrous insect.
The differential housings over the worm-screw drives gleamed like a
red, segmented carapace. The blue appendages of the solar cell
boxes were extended as if in some frantic appeal. The radar dish and
the helical antenna extended mutely upward. And, like a furious
proboscis, the exploratory drill, which would pierce the moon's skin to
a depth of five hundred feet, seemed to gnaw at the concrete floor of
the hangar.
Sam Jarvis, supervisor of electronic checkout, saw Jim Cochran enter
and came over to him with a broad, weary grin. "AOK, so far! This
package is going to be perfect. If only the rocket boys will set up a
bird that will take it to the moon—"
"They'd better," said Jim. "I don't think I could ever go through this
again if they dump the Prospector in the drink."

Sam turned back to look at the robot machine and the swarming
technicians. "Yes, you could," he said. "All of us have gone through
heartbreak time and again the past five years, watching them blow
up, or fall back and burn in the atmosphere because the motors didn't
ignite. Or seeing them get all the way to the moon and have some
five-dollar transistor conk out. But we always have at it again. You
will, too. You're new, but you're one of us now. You never back out
when you've come this far."
Watching the Prospector, Jim knew Sam was right. It had taken some
persuasion to bring him to this point, however. Until a couple of years
ago he had believed he would be content with ivory-tower plastics
research for the rest of his life. The persuasion had been applied
when Mary's brother, Allan Wright, had made the astronaut team.
Allan and Jim had grown up together. There was no other person Jim
felt closer to except Mary and their two children. Allan had dreamed
of space when they were kids, and when he was fifteen, he said, "I'm
going out there. I don't know how. But, somehow, I'm going out there."
Now, he had been selected to captain the first Apollo voyage. He had
been born for that purpose, he said.
But while he was still in the general pool of astronauts he had opened
his campaign to get Jim into the space program. "They need the best
brains they can get," Allan said. "You haven't got any right to sit in a
musty old plastics lab while guys with half your ability try to get us into
space. NASA will take you tomorrow!"
Jim didn't try to tell him that his plastics lab wasn't exactly musty, or
that he didn't think of himself as one of the best brains in the country.
But Mary sided with Allan; she was almost as excited about space as
he was. In the end, Jim went to NASA. Within days, he had been
assigned to head the development of the Prospector chemical
mechanization.
It had been something of a jolt to pull up all the roots he had so
carefully put down for him and his family, and move to the hectic,
bustling, space-frontier community of the Center. But he wasn't sorry.
It put something new in the blood, something men had never known
before.
Space!
The great Saturn lifted slowly, on a vast blossom of fire, with snowy
lox streaming down its sides. Then it was gone, a twinkle of fire high
above, among the stars. That was all.
Mary and Jim Cochran continued to stare at the fading twinkle, and
finally they turned away. Allan had obtained permission to be in the
blockhouse during the firing. It hadn't been necessary for Jim to be
there. He didn't want to know the instant-by-instant telemetry reports
which told whether or not the flight was successful. Sam or Allan
would call him when they knew. That would be soon enough for him.
"Let's drive down to the beach and watch the moon from there," said
Mary. "We can't just turn around and go home, like—like nothing had
happened."
Jim smiled in the darkness. Mary was as eager as he was for the
success of the flight. And she didn't have his fear of failure, that kept
him from wanting to know the maybe-yes, maybe-no indications that
the telemetry would first show.
"Sure," he said, "that's a good place to watch it."
The moon.

They watched its reflection thrashing on the water as the breakers


rolled across, under, and around it. It was the same image that men
had watched and wondered about and feared—for a half million
years. The first creatures that had any semblance of manhood had
sat on their haunches on this same shore and watched the same
moon and the same water.
And felt the same fears, Jim thought.
He didn't know whether it was fear or not, but there was some sense
of awesome mystery that filled him when he looked at the moon. It
had been that way all his life. He remembered how it was when he
was a boy and he walked through the fields at night on his way home.
He had to pass Cramer's Pond, and when the moon was up its light
from the sky and its reflection from the pond seemed to fill the whole
earth with a cold, silver light. He always hurried past the pond on
such nights.
Mary felt it, too. "I wonder why the moon makes people feel the way
they do."
"How does it make people feel?"
"Oh, kind of—kind of—you know!"
Jim laughed aloud. This was a typical Mary Cochran explanation. But
it told him all he needed to know. What she said was quite true. He
did know.
The baying of dogs on a wintery, moonlit night.
The madness called lunacy.
Seeds must be planted just so, in relation to the moon, or the crop will
fail.
Men had always felt strange things about the moon. Would a Saturn
missile and a mechanical monster in its nose be able to destroy all
that?
Jim started the car. "Let's get back. I've got to know how the flight's
going!"

They were still in the blockhouse, but the tension was relaxed. They
were talking and watching the meters and cathode ray tubes without
the strain and fear of failure. Jim knew the answer even before Sam
and Allan walked up to him and slapped him on the back.
"Where the devil did you go?" said Sam. "I thought you were going to
be right behind me when we fired, and you weren't here at all!"
"It's like your first baby, you want to be there, and you don't. Was it a
good shot?"
"Was it a good shot?" Allan's face became ecstatic. "We've never had
a better one. On course all the way!"
The Project Director, Emil Hennesey was behind them. His face was
bleak. "I expected you to be here for the firing, Cochran," he said. "It
seems to display little interest in your end of the project that you didn't
feel it necessary to show up."
Jim looked at him steadily and shrugged without answer. Hennesey
was one guy whose presence on the space team Jim couldn't figure
out. He was an ex-Major, and he had no capacity for dreaming. Men,
machines, transistors, rockets—they were all the same thing, merely
objects to be made to obey.
"You are aware of your next sequence of duties, I trust?" said
Hennesey.
Jim nodded curtly. "I'll be ready."

Sixty-six hours to the moon. That's what it takes with marginal escape
velocity and free-fall conditions. But it was really five hundred
thousand years and sixty-six hours, Jim thought. Surely there hadn't
been a single hour in all that time when someone, somewhere on
earth had not felt the longing to solve the secret mystery of the moon.
Now they were about to find the answer. But what would they have
when they found it? They would know that the surface dust of the
moon consisted of certain percentages of silicates and oxides. They
would know that the under layers were composed of rocks, maybe of
granite or limestone or basalt. They would determine how much of
each.
And then it would be over. The quest of the ages would be answered
with a few simple statements that could be obtained in any high-
school chemistry lab—if the lab were on the moon.
Jim Cochran felt there had to be more to it than that.
Why do dogs howl at the moon on winter nights?
Why do men say that madness of the mind is lunacy?
Why must planting be done in the right phase of the moon?
Little sleep was had by any of the crew during the next two nights,
even though the instrument stage of the ship was now completely
inert except for occasional telemetry signals that were fed to the
computers for course checking and correction. The ship was simply
falling on its own momentum.
Six hours before moonfall, activities in the tracking center accelerated
and the tension increased. There was no question of hitting the
moon; the landing had to be made safe for the cargo of instruments.
Jim Cochran watched the operators during this period. He told
himself he didn't understand it, but he had actually learned a great
deal of electronics during the past two years. He had had to in order
to design and operate a chemical laboratory 240,000 miles away.
The television screens came on, showing the pock-marked surface of
the moon as the ship orbited. The thrill and the fear of the great
unknown began to rise in Jim's throat. By the silence in the room, he
was sure the others sensed it, too.
Abruptly, the braking command was given and the ship began to fall
out of orbit towards the planned landing in the Sea of Rains. On the
screens, the images swelled as the ship plummeted faster. In one
corner could be seen the spring-loaded extension legs, like those of
some great spider. It seemed impossible that these could cushion the
violent shock of landing.
The sudden surge of a retro rocket and the blast of moondust blinded
the television eye, but there was a sense of crazy, rocking, rolling
motion. Then the eye went dead.
Jim almost cried out. The ship couldn't have crashed.

An operator quickly switched controls and the screens came alive


again. He turned a dial slowly. The camera eye moved. It swept the
craggy horizon and the nearby floor of the Sea of Rains. Others had
seen this before, but it was the first time for Jim. He found himself
pushing forward, drinking in the sight eagerly.
"The moon—the moon—" he said softly to himself. But the others
heard it and they understood.
Signals were sent across space to collapse the landing legs and
unfold the sides of the instrument cone like the leaves of a flower.
The Prospector lay exposed to the environment for which it was built.
Slowly, in response to other signals, the worm-screw drives, which
had been retracted against the body of the vehicle, turned through an
arc and lowered to the surface. Locked in position, the drive screws
began turning slowly. The vehicle moved off the now-useless landing
support and became an entity of its own.
The ungainly arms of the solar cells automatically oriented toward the
sun; the antennas pointed toward earth. The scanning cameras in the
turret of the Prospector took control of the video circuits and the turret
slowly turned as the vehicle moved across the face of the moon. The
landing support remained behind and slowly dwindled like some
useless wreckage.
There was sudden pandemonium in the tracking center control room.
The operators laid down their headsets and began pounding each
other on the back, while ear-splitting Indian yells filled the air. Jim and
Sam found themselves beating each other on the arms and yelling
senselessly.
"We made it!" Sam cried. "We made it! We got your little old
laboratory up there for you!"

There were hours of testing and calibration yet to be done before the
Prospector could be used for its primary mission. Hundreds of
electronic circuits had to be checked to see that they survived the
takeoff and landing without becoming distorted or inoperative.
Jim went home for the rest of the night. When he returned the next
morning Sam reported that all circuits were go, and the Prospector
was his.
He had operated the laboratory in the Prospector many times, either
on a mock-up or from this control panel while the Prospector was in
the hangar. But he couldn't keep the faint tremor from his hand as he
reached for the first control that would manipulate the machine on the
moon.
The drill had been extended to operating position, but the head had
not yet been energized. Jim touched it to the fine dust of the floor of
the Sea of Rains. The drill went quickly to a depth of eighteen inches
in the dust before it struck something firmer.
"That kills the theory about eighty feet of that stuff, anyway," said Sam
as he read the instruments.
Jim was not interested in depth at this time. He fed some of the
surface material into the laboratory and set the controls to run the
preprogrammed analysis. They waited minutes; then the analysis
began to appear in cryptic symbols on a paper tape.
Jim glanced at it and frowned.
"What's the matter? Isn't it working right?" Sam asked anxiously.
Jim hesitated. "It indicates the presence of several silicates, some
carbonates, and a high percentage of oxides. These are mostly of
sodium, calcium, and iron, as you might expect. But there's
something wrong with your calibration. The atomic and molecular
characteristics aren't coming through right."
"The boys ran checks on the standard samples aboard the
Prospector last night," said Sam. "The results tallied exactly. I'll show
you the tapes."

Jim waited, puzzled, while Sam brought up the check tapes. When he
saw them, he shook his head. "There's a standard calcium carbonate
sample carried aboard the Prospector. Here's a calcium carbonate
picked off the surface. You can see the difference yourself. The
nominal analysis is the same, but the atomic weights and the energy
levels are just slightly different. That doesn't make sense unless your
circuits are out of calibration."
"Let's run another standard sample," said Sam.
Within a few minutes the calibration check had been repeated. Jim
held up the tape. Sam peered over his shoulder. "Just like the first
one," said Sam. "Nothing's wrong with the circuits. Maybe you've got
some new stuff there, that's never been identified before."
"That's hardly possible," said Jim. "There aren't any new elements in
the places where sodium and calcium and silica are supposed to be.
Yet, I don't understand how this can be. If the atomic weights are
different, and the energy levels are different, they have to be different
elements. It doesn't make sense."
"Well, why don't we push on," said Sam, "that is, if you've completed
the surface sampling in this spot. Some samples at lower depths may
give other indications."
Jim agreed. He drove the drill deeper into the face of the moon. At
ten-foot intervals he removed samples and ran them through the
analyzer. The results were the same down to the hundred-foot level.
All results showed common chemical elements with slightly variant
atomic characteristics.
Which made them different chemical elements!
After six hours, Jim stood up from the console and shook his head
wearily. "It's no good, Sam. There's something wrong that I can't put
my finger on. If it isn't in the circuits, I don't know where it is. But
these readings just aren't right. There's no use going deeper until we
find out where the error is."
Sam's face was somber. "There just isn't any error. There can't be.
Unless it was made by whoever put the moon together—"
"Please make a complete check of every analyzer and telemetry
circuit tonight, and we'll try again tomorrow. I want to think about this."

He thought about it, and he dreamed about it. And along about three
o'clock in the morning he sat bolt upright in bed and stared at the dim
moonlight on the opposite wall of the bedroom.
It wasn't possible, he told himself audibly. It just wasn't possible!
Mary stirred and leaned on one elbow beside him. "What's the matter.
Are you having nightmares?"
"Yeah—yeah, I guess I am. I'll be back in a minute, honey." He got up
and padded to the door. "I've got to make a phone call."
"At this time of night?"
But Jim was gone. He turned on the hall light and dialed Sam's
number. After a long time Sam answered sleepily.
"Wake up!" said Jim. "I've just figured it out!"
"Who the devil—? Oh, it's you, Jim. Figured out what? Do you know
what time it is."
"Do you know the results of your calibration re-check?"
"How would I know that? I've got the night crew on it, but I didn't ask
them to report to me in the middle of the night. Go back to bed, and
let's talk about it in the morning."
"They're not going to find anything wrong, Sam."
"I could have told you that."
"But the elements of the moon are different—and there's only one
explanation."
"What?"
"Think about it a minute, Sam. We take a spectrograph of the sun,
and we find the same elements that are here on earth. We turn it on
Alpha Centauri and find the same thing. We turn it to the farthest
stars we can find that give enough light to record by. Always the
same. Calcium is calcium, whether it's on the earth or on a star a half
billion light years away."
"So?" Sam's voice was tired, and he sounded as if he was listening
only because Jim was too good a friend to tell to go to hell for calling
in the middle of the night.
"So? So what?" Sam repeated.
"So we go to the moon," said Jim, "and all of a sudden calcium isn't
calcium, and the sodium on the moon isn't the same as the sodium
on earth and on the sun and on Alpha Centauri and the stars a half
billion light years away. Don't you see what that means!"
"No, I guess not," said Sam dully. "Maybe in the morning—"
"It means the moon just doesn't belong, Sam! It means the moon is
completely foreign to anything in the Solar System, in the whole
galaxy—in any galaxy we have been able to analyze. It means the
moon has come from somewhere else, from a region of space where
atoms and electrons are not even the same as atoms and electrons
here. It must be a somewhere that's so far away it's beyond the edge
of space as we know it!"
"I'll get dressed and come over," said Sam.

Mary made chocolate and toast, and they sat around the kitchen
table thinking and talking of the awesome implications of Jim's theory.
"If what you say is true," said Sam, "it might be that the slightest
contact with any substance of the moon would be sheer poison to a
human being. A returning vessel could never be permitted to enter
the earth's atmosphere, and decontamination would become one of
the major branches of science."
"That's entirely possible. It would complicate enormously the
problems of establishing a moon-base. A speck of moondust inside
the base might be as lethal as an unshielded reactor."
Mary was looking out the kitchen window toward the thin crescent of
moon that was setting over the city. She thought of Allan, who would
soon be voyaging to that alien world. "It's like a trap up there in the
sky. We should never have tried to reach it."
"No—it's not like that at all," said Jim vigorously. "We'll solve whatever
problems we find there. But think of it! We don't have to build a ship
capable of crossing billions of light years of space to see what's out
there. Something from out there has come to us and parked right in
our own front yard. We have a thousand times more reason to go
now!"
Sam toyed with his toast and dunked it in the chocolate. "I think you
ought to keep it quiet—until we really know, don't you."
"Why? I'll run some more tests, sure. I'll plug every loophole there can
possibly be. But unless I find something new I'm going to announce it.
Why shouldn't I?"
"I don't think Hennesey will like it, for one thing. Too sensational.
Even when we actually land there and confirm your analyses by on-
the-spot checks—it's still only a theory that the moon doesn't belong
to this galaxy. You'll never be able to prove that."
"What we've found already is proof enough!"
"Not for Hennesey. He'll ask to see the shipping manifest by which
the moon was transferred here. You know Hennesey."
"Sure, I know Hennesey," said Jim bitterly. "And he doesn't count. Not
in something like this. This is big, and important, and I'm going to
announce it. I want the credit for discovering it. It'll be called
Cochran's Theory, and some University will offer me at least an
honorary Ph.D. Is that bad?"
Sam shook his head. "Of course it's not bad. But I wonder what the
public reaction will be like, and how about Congress—especially if
this business about possible poisoning from moondust turns out to be
correct? There might be a lot of pressure to cut funds and maybe
cancel the whole moon project."
"If moondust is lethal, there's no better time to be warned against it
than right now!"

He spent the following week, eighteen hours a day, at the chemical


analysis panel in the tracking station. As long as the moon was above
the horizon, day or night, he kept experiments going—checking, re-
checking, calibrating, searching for loopholes.
There were no loopholes. There was no malfunction of equipment.
The atoms of the moon's elements were not the same as those of the
rest of the galaxy.
When Allan next came to visit on leave from his own station, Jim told
him what had been found. Allan's face paled a little as he listened in
awe to the story. He stood up and paced across the room as Jim
finished.
"I always knew there would be something—something extra in this,"
he said. "You look up at night and you know the moon can't be just
another piece of earth. Now—you've found out what it is!
"How far could it have come? How old can it be? Imagine stepping
out onto a world so old, from so far away!"
"You haven't heard it all," said Mary tensely.
"There's more?"
"They think perhaps the slightest touch of moon substance may be
lethal."
"We don't know," said Jim hastily. "It's a thought that Sam advanced.
But I think it's quite possible. We won't know until we can run animal
tests. But special precautions will have to be taken to decontaminate
the Apollo after you re-enter with your space-suits."
"This will mean engineering changes. Are they under way?"
"I haven't announced my theory yet. But the necessary changes to
provide for decontamination will have to be made."
"I wanted this as much as you," said Mary. "But now it's gone all
wrong. We should have gone on dreaming about the moon and let it
be a dream that never came true. I'm afraid of it now. No man should
set foot on something so alien and so different."
Allan put an arm around her shoulders and shook her gently. "Sis!
What kind of talk is that? You're talking to the guy who's going to be
the first one to put his foot on the moon."

From the mountain of data accumulated in his experiments, Jim wrote


his paper. Hennesey could control the publication of any material

Вам также может понравиться