100% found this document useful (3 votes)
28 views

Download ebooks file (Ebook) Using and Administering Linux: Volume 2 Zero to SysAdmin: Advanced Topics by Both, David ISBN 9781484254547, 9781484254554, 1484254546, 1484254554 all chapters

Advanced

Uploaded by

gloryjudayoc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
28 views

Download ebooks file (Ebook) Using and Administering Linux: Volume 2 Zero to SysAdmin: Advanced Topics by Both, David ISBN 9781484254547, 9781484254554, 1484254546, 1484254554 all chapters

Advanced

Uploaded by

gloryjudayoc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Download the Full Ebook and Access More Features - ebooknice.

com

(Ebook) Using and Administering Linux: Volume 2


Zero to SysAdmin: Advanced Topics by Both, David
ISBN 9781484254547, 9781484254554, 1484254546,
1484254554
https://ebooknice.com/product/using-and-administering-linux-
volume-2-zero-to-sysadmin-advanced-topics-19057928

OR CLICK HERE

DOWLOAD EBOOK

Download more ebook instantly today at https://ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(Ebook) Using And Administering Linux: Volume 2 Zero To SysAdmin: Advanced Topics by
David Both ISBN 9781484296141, 1484296141

https://ebooknice.com/product/using-and-administering-linux-volume-2-zero-to-
sysadmin-advanced-topics-52689120

ebooknice.com

(Ebook) Biota Grow 2C gather 2C cook by Loucas, Jason; Viles, James ISBN
9781459699816, 9781743365571, 9781925268492, 1459699815, 1743365578, 1925268497

https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374

ebooknice.com

(Ebook) Using And Administering Linux: Volume 1 Zero To SysAdmin: Getting Started by
David Both ISBN 9781484296172, 1484296176

https://ebooknice.com/product/using-and-administering-linux-volume-1-zero-to-
sysadmin-getting-started-52446822

ebooknice.com

(Ebook) Using and Administering Linux: Volume 3, Zero to SysAdmin: Network Services,
2nd Edition by David Both ISBN 9781484297858, 1484297857

https://ebooknice.com/product/using-and-administering-linux-volume-3-zero-to-
sysadmin-network-services-2nd-edition-52621888

ebooknice.com
(Ebook) Using and Administering Linux Volume 1: From Zero to Linux Sysadmin Self-
Study by Both, David ISBN 9781484250488, 9781484250495, 9781484250501, 1484250486,
1484250494, 1484250508

https://ebooknice.com/product/using-and-administering-linux-volume-1-from-zero-
to-linux-sysadmin-self-study-18735402

ebooknice.com

(Ebook) Using and Administering Linux: Volume 1: Zero to SysAdmin: Getting Started,
2nd Edition by David Both ISBN 9781484296172, 9781484296189, 9781555582739,
1555582737, 1484296176, 1484296184

https://ebooknice.com/product/using-and-administering-linux-volume-1-zero-to-
sysadmin-getting-started-2nd-edition-52457028

ebooknice.com

(Ebook) Matematik 5000+ Kurs 2c Lärobok by Lena Alfredsson, Hans Heikne, Sanna
Bodemyr ISBN 9789127456600, 9127456609

https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312

ebooknice.com

(Ebook) SAT II Success MATH 1C and 2C 2002 (Peterson's SAT II Success) by Peterson's
ISBN 9780768906677, 0768906679

https://ebooknice.com/product/sat-ii-success-math-1c-and-2c-2002-peterson-s-sat-
ii-success-1722018

ebooknice.com

(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master the SAT Subject Test: Math
Levels 1 & 2) by Arco ISBN 9780768923049, 0768923042

https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-arco-master-
the-sat-subject-test-math-levels-1-2-2326094

ebooknice.com
Using and
Administering
Linux: Volume 2
Zero to SysAdmin: Advanced Topics

David Both
Using and Administering
Linux: Volume 2
Zero to SysAdmin: Advanced Topics

David Both
Using and Administering Linux: Volume 2
David Both
Raleigh, NC, USA

ISBN-13 (pbk): 978-1-4842-5454-7 ISBN-13 (electronic): 978-1-4842-5455-4


https://doi.org/10.1007/978-1-4842-5455-4

Copyright © 2020 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: Louise Corrigan
Development Editor: James Markham
Coordinating Editor: Nancy Chen
Cover designed by eStudioCalamar
Cover image designed by Freepik (www.freepik.com)
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street,
6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-
sbm.com, or visit www.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 rights@apress.com, or visit http://www.apress.com/
rights-permissions.
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 via the book's product page, located at www.apress.com/9781484254547. For more
detailed information, please visit http://www.apress.com/source-code.
Printed on acid-free paper
This book – this course – is dedicated to all Linux and
open source course developers and trainers.
:(){ :|:& };:
Table of Contents
About the Author����������������������������������������������������������������������������������������������������xix

About the Technical Reviewer��������������������������������������������������������������������������������xxi


Acknowledgments������������������������������������������������������������������������������������������������xxiii

Introduction�����������������������������������������������������������������������������������������������������������xxv

Chapter 1: Logical Volume Management������������������������������������������������������������������ 1


Objectives������������������������������������������������������������������������������������������������������������������������������������� 1
The need for logical volume management������������������������������������������������������������������������������������ 1
Running out of disk space in VirtualBox���������������������������������������������������������������������������������� 2
Recovery���������������������������������������������������������������������������������������������������������������������������������� 2
LVM structure�������������������������������������������������������������������������������������������������������������������������������� 3
Extending a logical volume����������������������������������������������������������������������������������������������������������� 4
Extending volume groups������������������������������������������������������������������������������������������������������������� 7
Create a new volume group – 1���������������������������������������������������������������������������������������������� 7
Create a new volume group – 2�������������������������������������������������������������������������������������������� 11
Tips��������������������������������������������������������������������������������������������������������������������������������������������� 13
Advanced capabilities����������������������������������������������������������������������������������������������������������������� 14
Chapter summary����������������������������������������������������������������������������������������������������������������������� 14
Exercises������������������������������������������������������������������������������������������������������������������������������������� 15

Chapter 2: File Managers��������������������������������������������������������������������������������������� 17


Objectives����������������������������������������������������������������������������������������������������������������������������������� 17
Introduction��������������������������������������������������������������������������������������������������������������������������������� 17
Text-mode interface�������������������������������������������������������������������������������������������������������������� 18
Graphical interface���������������������������������������������������������������������������������������������������������������� 18

v
Table of Contents

Default file manager������������������������������������������������������������������������������������������������������������������� 18


Text-mode file managers������������������������������������������������������������������������������������������������������������ 20
Midnight Commander������������������������������������������������������������������������������������������������������������ 20
Other text-mode file managers��������������������������������������������������������������������������������������������������� 31
Vifm��������������������������������������������������������������������������������������������������������������������������������������� 31
nnn���������������������������������������������������������������������������������������������������������������������������������������� 32
Graphical file managers�������������������������������������������������������������������������������������������������������������� 33
Krusader�������������������������������������������������������������������������������������������������������������������������������� 34
Thunar����������������������������������������������������������������������������������������������������������������������������������������� 37
Dolphin���������������������������������������������������������������������������������������������������������������������������������������� 38
XFE���������������������������������������������������������������������������������������������������������������������������������������������� 40
Chapter summary����������������������������������������������������������������������������������������������������������������������� 41
Exercises������������������������������������������������������������������������������������������������������������������������������������� 41

Chapter 3: Everything Is a File������������������������������������������������������������������������������� 43


Objectives����������������������������������������������������������������������������������������������������������������������������������� 43
What is a file?����������������������������������������������������������������������������������������������������������������������������� 43
Device files��������������������������������������������������������������������������������������������������������������������������������� 44
Device file creation���������������������������������������������������������������������������������������������������������������� 45
udev simplification���������������������������������������������������������������������������������������������������������������������� 45
Naming rules������������������������������������������������������������������������������������������������������������������������� 46
Device data flow������������������������������������������������������������������������������������������������������������������������� 47
Device file classification������������������������������������������������������������������������������������������������������������� 48
Fun with device files������������������������������������������������������������������������������������������������������������������� 50
Randomness, zero, and more������������������������������������������������������������������������������������������������������ 55
Back up the master boot record������������������������������������������������������������������������������������������������� 58
Implications of everything is a file���������������������������������������������������������������������������������������������� 65
Chapter summary����������������������������������������������������������������������������������������������������������������������� 65
Exercises������������������������������������������������������������������������������������������������������������������������������������� 66

vi
Table of Contents

Chapter 4: Managing Processes����������������������������������������������������������������������������� 67


Objectives����������������������������������������������������������������������������������������������������������������������������������� 67
Processes������������������������������������������������������������������������������������������������������������������������������������ 67
Process scheduling in the kernel������������������������������������������������������������������������������������������ 67
Tools�������������������������������������������������������������������������������������������������������������������������������������������� 68
top����������������������������������������������������������������������������������������������������������������������������������������� 69
More about load averages…������������������������������������������������������������������������������������������������������ 75
…and signals������������������������������������������������������������������������������������������������������������������������ 76
CPU hogs������������������������������������������������������������������������������������������������������������������������������������� 77
Process scheduling��������������������������������������������������������������������������������������������������������������������� 79
Nice numbers������������������������������������������������������������������������������������������������������������������������ 79
Killing processes������������������������������������������������������������������������������������������������������������������������� 82
Other interactive tools����������������������������������������������������������������������������������������������������������������� 83
atop��������������������������������������������������������������������������������������������������������������������������������������� 83
htop��������������������������������������������������������������������������������������������������������������������������������������� 86
Glances���������������������������������������������������������������������������������������������������������������������������������� 93
Other tools����������������������������������������������������������������������������������������������������������������������������� 96
The impact of measurement����������������������������������������������������������������������������������������������������� 102
Chapter summary��������������������������������������������������������������������������������������������������������������������� 102
Exercises����������������������������������������������������������������������������������������������������������������������������������� 103

Chapter 5: Special Filesystems���������������������������������������������������������������������������� 105


Objectives��������������������������������������������������������������������������������������������������������������������������������� 105
Introduction������������������������������������������������������������������������������������������������������������������������������� 105
The /proc filesystem����������������������������������������������������������������������������������������������������������������� 106
The /sys filesystem�������������������������������������������������������������������������������������������������������������� 116
Swap space������������������������������������������������������������������������������������������������������������������������������� 121
Types of Linux swap������������������������������������������������������������������������������������������������������������ 122
Thrashing����������������������������������������������������������������������������������������������������������������������������� 123
What is the right amount of swap space?��������������������������������������������������������������������������� 123
Adding more swap space on a non-LVM disk partition������������������������������������������������������� 126

vii
Table of Contents

Adding swap to an LVM disk environment��������������������������������������������������������������������������� 131


Other swap options with LVM���������������������������������������������������������������������������������������������� 135
Chapter summary��������������������������������������������������������������������������������������������������������������������� 135
Exercises����������������������������������������������������������������������������������������������������������������������������������� 136

Chapter 6: Regular Expressions��������������������������������������������������������������������������� 137


Objectives��������������������������������������������������������������������������������������������������������������������������������� 137
Introducing regular expressions����������������������������������������������������������������������������������������������� 137
Getting started�������������������������������������������������������������������������������������������������������������������������� 139
The mailing list�������������������������������������������������������������������������������������������������������������������� 139
grep������������������������������������������������������������������������������������������������������������������������������������������� 147
Data flow����������������������������������������������������������������������������������������������������������������������������� 147
regex building blocks���������������������������������������������������������������������������������������������������������� 148
Repetition���������������������������������������������������������������������������������������������������������������������������� 151
Other metacharacters���������������������������������������������������������������������������������������������������������� 152
sed�������������������������������������������������������������������������������������������������������������������������������������������� 154
Other tools that implement regular expressions����������������������������������������������������������������������� 156
Resources��������������������������������������������������������������������������������������������������������������������������������� 156
Chapter summary��������������������������������������������������������������������������������������������������������������������� 157
Exercises����������������������������������������������������������������������������������������������������������������������������������� 157

Chapter 7: Printing����������������������������������������������������������������������������������������������� 159


Objectives��������������������������������������������������������������������������������������������������������������������������������� 159
Introduction������������������������������������������������������������������������������������������������������������������������������� 160
About printers��������������������������������������������������������������������������������������������������������������������������� 160
Print languages������������������������������������������������������������������������������������������������������������������� 161
Printers and Linux��������������������������������������������������������������������������������������������������������������� 161
CUPS������������������������������������������������������������������������������������������������������������������������������������ 164
Creating the print queue������������������������������������������������������������������������������������������������������ 166
Printing to a PDF file����������������������������������������������������������������������������������������������������������������� 171
File conversion tools����������������������������������������������������������������������������������������������������������������� 174

viii
Table of Contents

a2ps������������������������������������������������������������������������������������������������������������������������������������� 175
ps2pdf��������������������������������������������������������������������������������������������������������������������������������� 177
pr����������������������������������������������������������������������������������������������������������������������������������������� 177
ps2ascii������������������������������������������������������������������������������������������������������������������������������� 178
Operating system–related conversion tools����������������������������������������������������������������������������� 180
unix2dos������������������������������������������������������������������������������������������������������������������������������ 181
dos2unix������������������������������������������������������������������������������������������������������������������������������ 183
unix2mac and mac2unix����������������������������������������������������������������������������������������������������� 183
Miscellaneous tools������������������������������������������������������������������������������������������������������������������ 184
lpmove��������������������������������������������������������������������������������������������������������������������������������� 184
wvText and odt2txt�������������������������������������������������������������������������������������������������������������� 187
Chapter summary��������������������������������������������������������������������������������������������������������������������� 189
Exercises����������������������������������������������������������������������������������������������������������������������������������� 189

Chapter 8: Hardware Detection���������������������������������������������������������������������������� 191


Objectives��������������������������������������������������������������������������������������������������������������������������������� 191
Introduction������������������������������������������������������������������������������������������������������������������������������� 191
dmidecode�������������������������������������������������������������������������������������������������������������������������������� 193
lshw������������������������������������������������������������������������������������������������������������������������������������������ 201
lsusb����������������������������������������������������������������������������������������������������������������������������������������� 205
usb-devices������������������������������������������������������������������������������������������������������������������������������ 207
lspci������������������������������������������������������������������������������������������������������������������������������������������ 209
Cleanup������������������������������������������������������������������������������������������������������������������������������������� 212
Chapter summary��������������������������������������������������������������������������������������������������������������������� 213
Exercises����������������������������������������������������������������������������������������������������������������������������������� 213

Chapter 9: Command-Line Programming������������������������������������������������������������� 215


Objectives��������������������������������������������������������������������������������������������������������������������������������� 215
Introduction������������������������������������������������������������������������������������������������������������������������������� 215
Definition of a program������������������������������������������������������������������������������������������������������������� 216
Simple CLI programs����������������������������������������������������������������������������������������������������������������� 217

ix
Table of Contents

Some basic syntax�������������������������������������������������������������������������������������������������������������� 217


Output to the display����������������������������������������������������������������������������������������������������������� 219
Something about variables�������������������������������������������������������������������������������������������������� 221
Control operators���������������������������������������������������������������������������������������������������������������������� 223
Return codes����������������������������������������������������������������������������������������������������������������������� 224
The operators���������������������������������������������������������������������������������������������������������������������� 225
Program flow control���������������������������������������������������������������������������������������������������������������� 227
true and false���������������������������������������������������������������������������������������������������������������������� 228
Logical operators����������������������������������������������������������������������������������������������������������������� 229
Grouping program statements�������������������������������������������������������������������������������������������������� 241
Expansions�������������������������������������������������������������������������������������������������������������������������������� 244
Brace expansion������������������������������������������������������������������������������������������������������������������ 245
Tilde expansion�������������������������������������������������������������������������������������������������������������������� 245
Pathname expansion����������������������������������������������������������������������������������������������������������� 245
Command substitution�������������������������������������������������������������������������������������������������������� 247
Arithmetic expansion����������������������������������������������������������������������������������������������������������� 248
for loops������������������������������������������������������������������������������������������������������������������������������������ 250
Other loops�������������������������������������������������������������������������������������������������������������������������������� 255
while������������������������������������������������������������������������������������������������������������������������������������ 255
until������������������������������������������������������������������������������������������������������������������������������������� 257
Chapter summary��������������������������������������������������������������������������������������������������������������������� 258
Exercises����������������������������������������������������������������������������������������������������������������������������������� 259

Chapter 10: Automation with Bash Scripts���������������������������������������������������������� 261


Objectives��������������������������������������������������������������������������������������������������������������������������������� 261
Introduction������������������������������������������������������������������������������������������������������������������������������� 262
Why I use shell scripts�������������������������������������������������������������������������������������������������������������� 262
Shell scripts������������������������������������������������������������������������������������������������������������������������� 263
Scripts vs. compiled programs�������������������������������������������������������������������������������������������� 264
Updates������������������������������������������������������������������������������������������������������������������������������������� 265
About updates��������������������������������������������������������������������������������������������������������������������� 265
Create a list of requirements����������������������������������������������������������������������������������������������� 265

x
Table of Contents

The CLI program������������������������������������������������������������������������������������������������������������������ 267


Convert the CLI program to a script������������������������������������������������������������������������������������ 267
Add some logic�������������������������������������������������������������������������������������������������������������������� 269
Limit to root������������������������������������������������������������������������������������������������������������������������� 271
Add command-line options������������������������������������������������������������������������������������������������� 272
Check for updates��������������������������������������������������������������������������������������������������������������� 274
Is a reboot required?����������������������������������������������������������������������������������������������������������� 276
Adding a Help function�������������������������������������������������������������������������������������������������������� 279
Finishing the script�������������������������������������������������������������������������������������������������������������� 282
About testing����������������������������������������������������������������������������������������������������������������������������� 283
Testing in production����������������������������������������������������������������������������������������������������������� 284
Fuzzy testing����������������������������������������������������������������������������������������������������������������������� 285
Testing the script����������������������������������������������������������������������������������������������������������������� 285
Making it better������������������������������������������������������������������������������������������������������������������������� 288
Licensing����������������������������������������������������������������������������������������������������������������������������������� 289
Automated testing��������������������������������������������������������������������������������������������������������������������� 292
Security������������������������������������������������������������������������������������������������������������������������������������� 292
Additional levels of automation������������������������������������������������������������������������������������������������� 293
Chapter summary��������������������������������������������������������������������������������������������������������������������� 295
Exercises����������������������������������������������������������������������������������������������������������������������������������� 296

Chapter 11: Time and Automation������������������������������������������������������������������������ 297


Objectives��������������������������������������������������������������������������������������������������������������������������������� 297
Introduction������������������������������������������������������������������������������������������������������������������������������� 297
Keeping time with chrony��������������������������������������������������������������������������������������������������������� 298
The NTP server hierarchy���������������������������������������������������������������������������������������������������� 298
NTP choices������������������������������������������������������������������������������������������������������������������������� 299
Chrony structure������������������������������������������������������������������������������������������������������������������ 300
Client configuration������������������������������������������������������������������������������������������������������������� 300
chronyc as an interactive tool��������������������������������������������������������������������������������������������� 304

xi
Table of Contents

Using cron for timely automation���������������������������������������������������������������������������������������������� 305


The crond daemon��������������������������������������������������������������������������������������������������������������� 306
crontab�������������������������������������������������������������������������������������������������������������������������������� 306
Other scheduling options���������������������������������������������������������������������������������������������������������� 312
/etc/cron.d��������������������������������������������������������������������������������������������������������������������������� 312
anacron������������������������������������������������������������������������������������������������������������������������������� 313
Thoughts about cron����������������������������������������������������������������������������������������������������������������� 315
Scheduling tips�������������������������������������������������������������������������������������������������������������������� 315
Security������������������������������������������������������������������������������������������������������������������������������� 316
cron resources��������������������������������������������������������������������������������������������������������������������� 316
at����������������������������������������������������������������������������������������������������������������������������������������������� 317
Syntax���������������������������������������������������������������������������������������������������������������������������������� 317
Time specifications������������������������������������������������������������������������������������������������������������� 317
Security������������������������������������������������������������������������������������������������������������������������������� 323
Cleanup������������������������������������������������������������������������������������������������������������������������������������� 323
Chapter summary��������������������������������������������������������������������������������������������������������������������� 323
Exercises����������������������������������������������������������������������������������������������������������������������������������� 324

Chapter 12: Networking���������������������������������������������������������������������������������������� 325


Objectives��������������������������������������������������������������������������������������������������������������������������������� 325
Introduction������������������������������������������������������������������������������������������������������������������������������� 325
About IPv6��������������������������������������������������������������������������������������������������������������������������� 326
Basic networking concepts������������������������������������������������������������������������������������������������������� 326
Definitions��������������������������������������������������������������������������������������������������������������������������� 326
MAC address����������������������������������������������������������������������������������������������������������������������� 328
IP address���������������������������������������������������������������������������������������������������������������������������� 331
TCP/IP��������������������������������������������������������������������������������������������������������������������������������������� 334
The TCP/IP network model�������������������������������������������������������������������������������������������������� 334
A simple example���������������������������������������������������������������������������������������������������������������� 336

xii
Table of Contents

CIDR – Network notation and configuration������������������������������������������������������������������������������ 338


Network classes������������������������������������������������������������������������������������������������������������������ 338
Along came a CIDR�������������������������������������������������������������������������������������������������������������� 341
Variable Length Subnet Masking����������������������������������������������������������������������������������������� 344
DHCP client configuration��������������������������������������������������������������������������������������������������������� 348
NIC naming conventions����������������������������������������������������������������������������������������������������������� 349
How it works – sort of��������������������������������������������������������������������������������������������������������� 349
NIC configuration files��������������������������������������������������������������������������������������������������������������� 351
Create an interface configuration file���������������������������������������������������������������������������������� 352
The interface configuration file������������������������������������������������������������������������������������������������� 354
The network file������������������������������������������������������������������������������������������������������������������� 359
The route-<interface> file��������������������������������������������������������������������������������������������������� 359
Other network files�������������������������������������������������������������������������������������������������������������� 360
Network startup������������������������������������������������������������������������������������������������������������������������ 360
The NetworkManager service��������������������������������������������������������������������������������������������� 360
Name services�������������������������������������������������������������������������������������������������������������������������� 361
How a name search works�������������������������������������������������������������������������������������������������� 362
Using the /etc/hosts file������������������������������������������������������������������������������������������������������ 363
Introduction to network routing������������������������������������������������������������������������������������������������ 367
The routing table����������������������������������������������������������������������������������������������������������������� 367
iptraf-ng������������������������������������������������������������������������������������������������������������������������������������ 373
Cleanup������������������������������������������������������������������������������������������������������������������������������������� 377
Chapter summary��������������������������������������������������������������������������������������������������������������������� 377
Exercises����������������������������������������������������������������������������������������������������������������������������������� 378

Chapter 13: systemd��������������������������������������������������������������������������������������������� 379


Objectives��������������������������������������������������������������������������������������������������������������������������������� 379
Introduction������������������������������������������������������������������������������������������������������������������������������� 379
Controversy������������������������������������������������������������������������������������������������������������������������������� 380
Why I prefer SystemV���������������������������������������������������������������������������������������������������������� 380
Why I prefer systemd����������������������������������������������������������������������������������������������������������� 381
The real issue���������������������������������������������������������������������������������������������������������������������� 382
xiii
Table of Contents

systemd suite���������������������������������������������������������������������������������������������������������������������������� 382


Practical structure��������������������������������������������������������������������������������������������������������������� 383
systemctl���������������������������������������������������������������������������������������������������������������������������������� 384
Service units������������������������������������������������������������������������������������������������������������������������ 388
Mount units������������������������������������������������������������������������������������������������������������������������� 391
systemd timers������������������������������������������������������������������������������������������������������������������������� 395
Time specification��������������������������������������������������������������������������������������������������������������� 396
Timer configuration������������������������������������������������������������������������������������������������������������� 399
systemd-analyze����������������������������������������������������������������������������������������������������������������������� 403
Journals������������������������������������������������������������������������������������������������������������������������������������ 404
Chapter summary��������������������������������������������������������������������������������������������������������������������� 407
References�������������������������������������������������������������������������������������������������������������������������������� 408
Exercises����������������������������������������������������������������������������������������������������������������������������������� 410

Chapter 14: D-Bus and udev��������������������������������������������������������������������������������� 411


Objectives��������������������������������������������������������������������������������������������������������������������������������� 411
/dev chaos�������������������������������������������������������������������������������������������������������������������������������� 411
About D-Bus������������������������������������������������������������������������������������������������������������������������ 412
About udev�������������������������������������������������������������������������������������������������������������������������� 412
Naming rules����������������������������������������������������������������������������������������������������������������������������� 415
Making udev work�������������������������������������������������������������������������������������������������������������������� 416
Using Udev for your success����������������������������������������������������������������������������������������������� 416
Chapter summary��������������������������������������������������������������������������������������������������������������������� 423
Exercises����������������������������������������������������������������������������������������������������������������������������������� 424

Chapter 15: Logs and Journals����������������������������������������������������������������������������� 425


Objectives��������������������������������������������������������������������������������������������������������������������������������� 425
Logs are your friend������������������������������������������������������������������������������������������������������������������ 425
SAR������������������������������������������������������������������������������������������������������������������������������������������� 426
logrotate������������������������������������������������������������������������������������������������������������������������������������ 429
messages���������������������������������������������������������������������������������������������������������������������������������� 433

xiv
Table of Contents

Mail logs����������������������������������������������������������������������������������������������������������������������������������� 435


dmesg��������������������������������������������������������������������������������������������������������������������������������������� 436
secure��������������������������������������������������������������������������������������������������������������������������������������� 438
Following log files��������������������������������������������������������������������������������������������������������������������� 440
systemd journals����������������������������������������������������������������������������������������������������������������������� 442
logwatch����������������������������������������������������������������������������������������������������������������������������������� 446
Chapter summary��������������������������������������������������������������������������������������������������������������������� 456
Exercises����������������������������������������������������������������������������������������������������������������������������������� 456

Chapter 16: Managing Users�������������������������������������������������������������������������������� 459


Objectives��������������������������������������������������������������������������������������������������������������������������������� 459
Introduction������������������������������������������������������������������������������������������������������������������������������� 459
The root account����������������������������������������������������������������������������������������������������������������������� 460
Your account����������������������������������������������������������������������������������������������������������������������������� 460
Your home directory������������������������������������������������������������������������������������������������������������ 461
User accounts and groups�������������������������������������������������������������������������������������������������������� 461
The /etc/passwd file������������������������������������������������������������������������������������������������������������ 463
nologin shells���������������������������������������������������������������������������������������������������������������������� 467
The /etc/shadow file������������������������������������������������������������������������������������������������������������ 467
The /etc/group file��������������������������������������������������������������������������������������������������������������� 472
The /etc/login.defs file��������������������������������������������������������������������������������������������������������� 472
Account configuration files�������������������������������������������������������������������������������������������������� 472
Password security��������������������������������������������������������������������������������������������������������������������� 473
Password encryption����������������������������������������������������������������������������������������������������������� 474
Generating good passwords������������������������������������������������������������������������������������������������ 476
Password quality����������������������������������������������������������������������������������������������������������������� 478
Managing user accounts����������������������������������������������������������������������������������������������������������� 480
Creating new accounts�������������������������������������������������������������������������������������������������������� 480
Creating new accounts by editing the files������������������������������������������������������������������������� 483
Locking the password��������������������������������������������������������������������������������������������������������� 486
Deleting user accounts�������������������������������������������������������������������������������������������������������� 487

xv
Table of Contents

Forcing account logoff�������������������������������������������������������������������������������������������������������������� 488


Setting resource limits�������������������������������������������������������������������������������������������������������������� 489
Chapter summary��������������������������������������������������������������������������������������������������������������������� 493
Exercises����������������������������������������������������������������������������������������������������������������������������������� 493

Chapter 17: Security��������������������������������������������������������������������������������������������� 495


Objectives��������������������������������������������������������������������������������������������������������������������������������� 495
Introduction������������������������������������������������������������������������������������������������������������������������������� 495
Security by obscurity����������������������������������������������������������������������������������������������������������� 497
What is security?����������������������������������������������������������������������������������������������������������������� 497
Data protection�������������������������������������������������������������������������������������������������������������������� 498
Security vectors������������������������������������������������������������������������������������������������������������������������ 498
Self-inflicted problems�������������������������������������������������������������������������������������������������������� 499
Environmental problems����������������������������������������������������������������������������������������������������� 499
Physical attacks������������������������������������������������������������������������������������������������������������������ 500
Network attacks������������������������������������������������������������������������������������������������������������������ 501
Software vulnerabilities������������������������������������������������������������������������������������������������������� 502
Linux and security��������������������������������������������������������������������������������������������������������������������� 502
Login security��������������������������������������������������������������������������������������������������������������������������� 503
Checking logins������������������������������������������������������������������������������������������������������������������������� 504
Telnet���������������������������������������������������������������������������������������������������������������������������������������� 508
SSH������������������������������������������������������������������������������������������������������������������������������������������� 516
The SSH server�������������������������������������������������������������������������������������������������������������������� 516
Firewalls����������������������������������������������������������������������������������������������������������������������������������� 520
firewalld������������������������������������������������������������������������������������������������������������������������������� 521
iptables�������������������������������������������������������������������������������������������������������������������������������� 527
Fail2Ban������������������������������������������������������������������������������������������������������������������������������������ 535
PAM������������������������������������������������������������������������������������������������������������������������������������������� 538
Some basic steps���������������������������������������������������������������������������������������������������������������������� 539
Chapter summary��������������������������������������������������������������������������������������������������������������������� 542
Exercises����������������������������������������������������������������������������������������������������������������������������������� 542

xvi
Table of Contents

Chapter 18: Backup Everything – Frequently������������������������������������������������������� 545


Introduction������������������������������������������������������������������������������������������������������������������������������� 545
Backups to the rescue�������������������������������������������������������������������������������������������������������������� 545
The problem������������������������������������������������������������������������������������������������������������������������ 546
Backup options������������������������������������������������������������������������������������������������������������������������� 552
tar���������������������������������������������������������������������������������������������������������������������������������������������� 552
Off-site backups������������������������������������������������������������������������������������������������������������������������ 557
Disaster recovery services�������������������������������������������������������������������������������������������������������� 558
Options�������������������������������������������������������������������������������������������������������������������������������������� 559
What about the “frequently” part?�������������������������������������������������������������������������������������������� 559
How frequent is “frequently?”��������������������������������������������������������������������������������������������� 560
What does “full” really mean?��������������������������������������������������������������������������������������������� 560
All vs. diff����������������������������������������������������������������������������������������������������������������������������� 561
Considerations for automation of backups�������������������������������������������������������������������������� 561
Dealing with offline hosts���������������������������������������������������������������������������������������������������� 562
Advanced backups�������������������������������������������������������������������������������������������������������������� 562
Chapter summary��������������������������������������������������������������������������������������������������������������������� 563
Exercises����������������������������������������������������������������������������������������������������������������������������������� 563

Bibliography��������������������������������������������������������������������������������������������������������� 565
Books���������������������������������������������������������������������������������������������������������������������������������������� 565
Web sites���������������������������������������������������������������������������������������������������������������������������������� 566

Index��������������������������������������������������������������������������������������������������������������������� 571

xvii
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 20 years
and has been working with computers for over 45 years.
He is a strong proponent of and evangelist for the “Linux
Philosophy for System Administrators.” David has been in
the IT industry for over 40 years.
Mr. Both 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 worked at
MCI WorldCom, Cisco, and the State of North Carolina. In
most of the places he has worked since leaving IBM in 1995, he has taught classes on
Linux ranging from Lunch'n'Learns to full 5-day courses. Helping others learn about
Linux and open source software is one of his great pleasures.
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 Thermaltake Core X9 case.
He has written articles for magazines including Linux Magazine, Linux Journal, and
OS/2 back when there was such a thing. His article “Complete Kickstart,” co-authored
with a colleague at Cisco, was ranked 9th in the Linux Magazine Top Ten Best System
Administration Articles list for 2008. He currently writes prolifically and is a volunteer
community moderator for Opensource.com. He particularly enjoys learning new things
while researching his articles.
David currently lives in Raleigh, NC, with his very supportive wife and a strange rescue
dog that is mostly Jack Russell. David also likes reading, travel, the beach, old M*A*S*H
reruns, and spending time with his two children, their spouses, and four grandchildren.
David can be reached at LinuxGeek46@both.org or on Twitter @LinuxGeek46.

xix
About the Technical Reviewer
Jason Baker has been a Linux user since the early 2000s,
ever since stuffing a Slackware box under his desk and trying
to make the darn thing work. He is a writer and presenter
on a variety of open source projects and technologies,
many of which can be found on Opensource.com. A Red
Hat Certified Systems Administrator, he is currently the
managing editor of Enable SysAdmin, Red Hat's community
publication for system administrators. When he's not at
work, he enjoys tinkering with hardware and using open
source tools to play with maps and other visualizations of
cool data sets. He lives in Chapel Hill, NC, with his wife, Erin,
and their rescue cat, Mary.

xxi
Acknowledgments
Writing a book is not a solitary activity, and this massive three-volume Linux training
course required a team effort so much more 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.
I am grateful for the support and guidance of Louise Corrigan, senior editor for open
source at Apress, who believed in me and my vision for this book. This book would not
have been possible without her.
To my coordinating editor, Nancy Chen, I owe many thanks for her hours of work,
guidance, and being there to discuss many aspects of this book. As it grew and then
continued to grow some more, our discussions were invaluable in helping to shape the
final format of this work.
And to Jim Markham, my development editor, who quietly kept an eye and a guiding
hand on the vast volume of material in these three volumes to ensure that the end result
would meet the needs of you – my readers – and most importantly, you as the student.
Jason Baker, my intrepid technical reviewer, has done an outstanding job to ensure
the technical accuracy of all three volumes of this course. Due to the major changes
made in some parts of the course as its final form materialized, he retested some
chapters in their entirety to help ensure that I had not screwed anything up. Jason also
made important suggestions that have significantly enhanced the quality and scope
of the entire three-volume work. These volumes are much better for his contributions.
Jason’s amazing work and important contributions to this book and the course of which
it is part have helped to make it far better than it might have been.
Of course any remaining errors and omissions are my responsibility alone.

xxiii
Introduction
First, thank you for purchasing Using and Administering Linux: Volume 2 – Zero to
SysAdmin: Advanced Topics. The Linux training course upon which you have embarked
is significantly different from other training that you could purchase to learn about Linux.

About this course


This Linux training course, Using and Administering Linux – Zero to SysAdmin, consists
of three volumes. Each of these three volumes is closely connected and they build
upon each other. For those new to Linux, it’s best to start here with Volume 1, where
you’ll be guided through the creation of a virtual laboratory – a virtual network and a
virtual machine – that will be used and modified by many of the experiments in all three
volumes. More experienced Linux users can begin with later volumes and download
the script that will set up the VM for the start of Volumes 2 and 3. Instructions provided
with the script will provide specifications for configuration of the virtual network and the
virtual machine.
Refer to the following volume overviews to select the volume of this course most
appropriate for your current skill level.
This Linux training course differs from others because it is a complete self-study
course. Newcomers should start at the beginning of Volume 1 and read the text, perform
all of the experiments, and complete 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.

xxv
Introduction

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.
Inside, each chapter has specific learning objectives, interactive experiments, and
review exercises that include both hands-on experiments and some review questions.
I learned this format when I worked as a course developer for IBM from 1978 through
1981. It is a tried and true format that works well for self-study.
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.

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

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

xxvi
Introduction

Many Linux training courses begin with the assumption that the first course a
student should take is one designed to start them as users. 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 – our deep
need – 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 and experimenting with it to see what its limits are, what breaks it, and 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 do not know everything – that is 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 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.
xxvii
Introduction

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.

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.

C
 ontent overview
Because there are three volumes to this course and because I reference other chapters,
some of which may be in other volumes, we need a method for specifying in which
volume the referenced material exists. If the material is in another volume, I will always
specify the volume number, that is, “Chapter 2 in Volume 3” or “Volume 2, Chapter 5.” If
the material is in the same volume as the reference to it, I may simply specify the chapter
number; however, I may also reference the current volume number for clarity.
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.

xxviii
Introduction

 sing and Administering Linux: Volume 1


U
Zero to SysAdmin: Getting Started
Volume 1 of this training course introduces operating systems in general and Linux in
particular. It briefly explores The Linux Philosophy for SysAdmins1 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. In Chapter 6
you will learn 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.
Chapters 11 through 13 start your work as a SysAdmin and take you through some
specific tasks such as 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 file 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. The Linux command line

1
Both, David, The Linux Philosophy for SysAdmins, Apress, 2018

xxix
Introduction

8. Core utilities

9. Data streams

10. Text editors

11. Working as root

12. Installing updates and 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


U
Zero to 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 1 and 2 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 3 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 4 you will learn to use several tools that enable the SysAdmin to manage
and monitor running processes. Chapter 5 enables you to experience the power of the
special filesystems, such as /proc, that enable us as SysAdmins to monitor and tune the
kernel while it is running – without a reboot.
Chapter 6 will introduce you to regular expressions and the power that using them for
pattern matching can bring to the command line, while Chapter 7 discusses managing
printers and printing from the command line. In Chapter 8 you will use several tools to
unlock the secrets of the hardware in which your Linux operating system is running.

xxx
Introduction

Chapters 9 through 11 show you how to do some simple – and not so simple –
command-line programming and how to automate various administrative tasks.
You will begin to learn the details of networking in Chapter 12, and Chapters 13
through 15 show you how to manage the many services that are required in a Linux
system. You will also explore the underlying software that manages the hardware and
can detect when hardware devices such as USB thumb drives are installed and how the
system reacts to that.
Chapter 16 shows you how to use the logs and journals to look for clues to problems
and confirmation that things are working correctly.
Chapters 17 and 18 show you how to enhance the security of your Linux systems,
including how to perform easy local and remote backups:

1. Logical volume management

2. File managers

3. Everything is a file

4. Managing processes

5. Special filesystems

6. Regular expressions

7. Printing

8. Hardware detection

9. Command-line programming

10. Automation with BASH scripts

11. Time and automation

12. Networking

13. systemd

14. dbus and udev

15. Using logs and journals

16. Managing users

17. Security

18. Backups

xxxi
Introduction

 sing and Administering Linux: Volume 3


U
Zero to 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 2 begins this transformation from simple workstation to server by adding
a new network interface card (NIC) to the VM so that it can act as a firewall and router,
then changing its network configuration from DHCP to static. 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.
Chapters 3 and 4 guide you through setting up the necessary services, DHCP and
DNS, that are required to support a managed, internal network, and Chapter 5 takes you
through configuration of SSHD to provide secure remote access between Linux hosts.
In Chapter 6 you will convert the new server into a router with a simple yet effective
firewall.
You will learn to install and configure an enterprise class email server that can
detect and block most spam and malware in Chapters 7 through 9. Chapter 10 takes you
through setting up a web server, and in Chapter 11 you will set up WordPress, a flexible
and powerful content management system.
In Chapter 12 you return to email by setting up a mailing list using Mailman.
Then Chapter 13 guides you through sharing files to both Linux and Windows hosts.
Sometimes accessing a desktop remotely is the only way to do some things, so in
Chapter 14 you will do just that.
Chapter 15 shows you how to set up a time server on your network and how to
determine its accuracy. Although we have incorporated security in all aspects of what
has already been covered, Chapter 16 covers some additional security topics.
Chapter 17 discusses package management from the other direction by guiding you
through the process of creating an RPM package for the distribution of your own scripts
and configuration files.

xxxii
Introduction

Finally, Chapter 18 will get you started in the right direction because I know you are
going to ask, “Where do I go from here?”

1. Preparation

2. Server configuration

3. DHCP

4. Name services – DNS

5. Remote access with SSH

6. Routing and firewalls

7. Introducing email

8. Email clients

9. Combating spam

10. Apache web server

11. WordPress

12. Mailing lists

13. File sharing with NFS and SAMBA

14. Using remote desktop access

15. Does anybody know what time it is?

16. Security
17. Advanced package management

18. Where do I go from here?

Taking this course


Although designed primarily as a self-study guide, this course can be used effectively in
a classroom environment. This course can also be used very effectively as a reference.
Many of the original course materials I wrote for Linux training classes I used to teach
as an independent trainer and consultant were valuable to me as references. The
experiments became models for performing many tasks and later became the basis for

xxxiii
Discovering Diverse Content Through
Random Scribd Documents
Fig. 116.—Correction of Lobular Defect.
Fig. 117.—Coaptation of Wound.

Fig. 118. Fig. 119.


Greene Method.

The bistoury is thrust through the lobule at the point A and an


incision is made to follow at a little distance the defect along the line
D. This frees the cicatrix except at the pedicle A. A transverse
incision is now made above the point A corresponding to the curved
exsection of the opposite side except for a thin strip of tissue B. This
delicate little flap is preserved and severed a short distance beyond.
The raw edges when now brought in apposition will assume the
form in Fig. 119. The wound is sutured as in the simpler operation.
Fig. 120.—Noyes’s Clamp.

These operations are best performed under local anesthesia, the


two-per-cent eucain being preferred. There is practically little
bleeding, but even this may be avoided by applying a large Noyes’
compression clamp with its angular arms so placed as to include the
entire lobule (Fig. 120).

MALFORMATION OF THE LOBULE


There may be an enlargement of or an absence of the lobule.

Enlargement of the Lobule

In the enlargement of the lobule the operation last described may


be resorted to, making the now supposed coloboma the triangular
amount of tissue to be removed. It will be found that the upper curve
of the incisions must be carried much higher in cases of this kind,
furthermore, that they should define a sharper angle at this point.
The simple exsection of a triangular piece of the lobule and
suturing is commonly practiced, with the objection of the notch
previously referred to. This operation is very quickly done, and if care
be taken in bringing the raw surfaces together neatly a splendid
result is attained, especially if the incisions are made obliquely to the
plane of the skin.

Attachment of the Lobe


There may be a shortening of the lobule, or, as is more frequently
seen, the attachment of the inner lateral border of the lobe to the
skin opposite.
This attachment of the lobe has been alleged by criminologists to
be a mark of the degenerate. If this be so it can scarcely apply to the
Japanese, in whom it is found as a racial fact.
As the defect is often objected to by patients its correction may be
considered briefly.
An incision is made in the inferior auricle and in the skin below it,
as shown by the dotted lines in Fig. 121, removing the triangular
piece of tissue included therein.

Fig. 121. Fig. 122.


Correction of Attached Lobe.

The wound is then sutured with fine silk, as shown in Fig. 122, and
allowed to heal. The result is very gratifying in most cases.

MALFORMATION OF THE AURICLE


Malformations of the ear are due to the arrest of development,
termed microtia, excessive development, or macrotia, and
malposition.

Microtia

The total absence of the auricular appendage is quite rare. One or


the other part of the ear is usually found, either partially or fully
developed, giving to the ear an irregular rolled-up appearance. This
defect may be unilateral or bilateral.
It may be associated with congenital fistula (Fistula auris
congenita), varying in length from one fourth to one inch, and
secreting a serouslike fluid. These fistulæ are usually found
anteriorly and above the tragus, the lobule, or more rarely at the crus
helix, or even behind the ear. Sometimes these fistulæ communicate
with the middle ear or even the esophagus. They are due to
imperfect development in utero. In microtia little can be done
surgically, since the malformation is usually so pronounced as to
exclude all methods of restoration.
Szymanowski advises making an ear from the skin immediately
back of the auditory canal if present, making the incisions of the
shape shown in Fig. 123.
Fig. 123.—Restoration of Auricle,
Szymanowski Method.

The flap included in these incisions is dissected up and doubled


on itself posteriorly. The doubled flap thus formed is brought forward
and placed as near into the linear position as the ear should have.
The flap is then sutured through and through to make the raw
surfaces heal together. The secondary wound and the treatment of
the flap are carried out as already referred to under restoration of the
auricle.
Several later delicate operations are done to add to the shape of
the newly made organ, but at best the effect is far from even good.
In the case of Mr. B., illustrated in Fig. 124, an attempt was made
to enlarge the somewhat elastic roll of tissue corresponding to the
helix by several injections of paraffin. The result proved to be
anything but satisfactory; in fact, the prominence of the malformed
upper ear was made more evident, and painful when subjected to
pressure, so that the patient was compelled to refrain from lying on
that side of the head.
Fig. 124.—Auricular Stump for Attachment
of Artificial Ear.
Fig. 125.—Auricular Prothesis.

There had been also congenital atresia of the auditory meatus,


which had been operated for, leaving a hair-lined opening, leading
down to a useless middle ear, a condition sometimes associated with
microtia.
In presenting himself to the author for operation it was decided
that the otoplastic methods for the restoration of the ear were out of
the question, as is usually the fact in these cases.
The hard mass of tissue referred to and corresponding to the helix
was reduced considerably, so that the stump obtained was soft and
pliable, with not only the object of overcoming the sensitiveness and
inconvenience of the part, but to obtain as good a base for the
attachment of an artificial ear as possible (see Fig. 124).
Fig. 126.—Auricular Prothesis Applied to
Stump.
Fig. 127.—Anterior View of Auricular
Prothesis.
Fig. 128.—Posterior View of Auricular
Prothesis.

The author advises a complete amputation of such


underdeveloped ears, since a better and firmer seat of attachment is
offered thereby to the prothesis to be worn over it, at the same time
giving the artificial organ a better position in reference to its normal
relation to the face. An irregular stump makes this more or less
difficult, as in the case just referred to, but even these patients are
loath to part with an irregular ugly mass of tissue they consider
themselves thankful to be born with.
The auricular prothesis used in this case is shown in Fig. 125, and
its position and appearance when placed on the stump is shown in
Fig. 126.
Another, showing both anterior and posterior surfaces, is given in
Figs. 127 and 128.
The fistular conditions mentioned should be thoroughly dissected
out and healed from the bottom when practical by antiseptic gauze
packing. Those involving the middle ear require special treatment
that cannot be included under plastic procedure.

Macrotia

Abnormal enlargement of the ear is often found in the idiot, but is


commonly seen as a hereditary defect in many without having the
least relation to the mental development of the person. These
conditions occur more frequently in men than in women.
Enlargement always depends upon overdevelopment of the
cartilaginous structure of the auricle, and may also be the result of
direct violence, the result of blows upon the organ, as in prize
fighters, football players, and other athletes.
Following violence the auricle undergoes either an acute or
chronic hypertrophy of the chondrium, resulting in the condition
known as the “cauliflower ear.”
Again, there may be hematoma occasioned by direct violence,
termed othematoma traumaticum, or a spontaneous development of
such hematoma without any appreciable injury, as found in the
insane. In the latter form the disease appears suddenly without
warning or inflammatory manifestations, the hematoma reaching its
full size in three or four days, after which a passive resolution in the
form of absorption of the tumor takes place associated more or less
with an organization of the blood mass, and leaving the auricular
appendage unduly enlarged, distorted, and thickened, with here and
there islands of seemingly detached or displaced cartilage firmly
adherent to the overlying skin.
Early in these cases much can be done by the application of
external medication, depletion, and pressure bandage, and the
removal of the effusion producing the swelling and lying between the
perichondrium and the cartilage, by the introduction of a trocar
cannula or by incision, as may be required.
The union between cartilage and perichondrium is always slow,
requiring about three weeks in the traumatic variety and often
months in the noninflammatory form.
Be the enlargement due to whatever cause, the patient not
infrequently presents himself for a correction of the deformity.
The slightest of such deformities is a tiplike enlargement of the
outer and upper angle of the helix, most commonly unilateral. This
has been termed “fox ear.”
In this condition there is more or less loss of the curl of the helix,
with flattening beginning well down in the fossa, extending upward,
and terminating in a triangular cartilaginous tip resembling the ear of
an animal, hence the name.
The correction of this fault is quite simple. An incision somewhat
larger than the base of the cartilaginous triangle is made under a
local anesthetic about one fourth inch below and back of the line
corresponding to the superior border of the helix. The cartilage is
exposed through this incision and excised with a fine curved scissors
without wounding the anterior skin of the helix, and the incision
neatly sutured, leaving the now redundant skin to contract.
In this manner the fault is corrected without any appreciable scar.
The sutures can be removed in three or four days.
In the correction of macrotia various surgical methods may be
employed, yet none can be emphasized, as exclusively indicated,
inasmuch as the enlargements may involve one or the other part of
the pinna.
The greatest fault with most of these ears lies in the
overdevelopment of the triangular antihelix or that area lying
posterior to the fossa of the antihelix and the fossa of the helix,
although in many cases the greatest malformation is found in the
concha itself.
The following methods for operation are therefore given not so
much for their individual merit, but to act as a guide in the selection
of an appropriate election or modification for specific cases.
Schwartze Method.—Schwartze advises and has obtained
excellent results by removing a long elliptical piece of the entire
thickness of the pinna, including both skin and cartilage, from the
fossa of the helix, followed by the excision of a triangular section with
its base corresponding to the outer border of the helix and its apex
terminating well in the concavity of the concha. The scheme of
procedure is shown in Figs. 129 and 130. The raw edges are
brought together by fine silk sutures, which are made to pass directly
through the cartilage, and tied carefully to prevent any change of the
transfixed parts, which would mar the result of the operation more or
less and necessitate further interference. The arrangement of the
sutures and the disposition of the parts are shown in Fig. 131.

Fig. 129. Fig. 130. Fig. 131.


Schwartze Method.

Parkhill Method.—Parkhill advises a semilunar incision from the


fossa of the helix with a rhomboidal exsection of the helix, as shown
in Fig. 132, and suturing the parts, as shown in Fig. 133.
Fig. 132. Fig. 133.
Parkhill Method.

The tonguelike ends of the semilunar incisions must, of course,


vary in length, according to the amount of tissue necessary to
remove to facilitate accurate juxtaposition of the newly designed
flaps.
Author’s Method.—The latter operation is most successful where
the upper part of the pinna is unusually flat. It does not correct this
flatness, however, which is often an objection, hence the author
suggests excising a section of the entire thickness of the ear from
the fossa somewhat in the form shown in Fig. 134, curving the two
deeper invading incisions, so that when the parts are brought
together a concavity will be given the antihelix, as in the natural
auricle.
Fig. 134. Fig. 135.
Author’s Method.

The rearrangement of the parts in this event is shown in Fig. 135.


The only objection to the above may be found in the two linear scars
across the antihelix entirely overcome by the Parkhill operation,
wherein the line of union falls just below the rim of the helix and into
the groove commonly found there, yet any of these scars shows little
in well-done operations and when union takes place by first intention.
There will always appear a notchlike depression where the newly
cut ends of the helix are brought together, owing to the cicatrix
involving the space between the cartilaginous borders.
Inasmuch as this notch necessarily shows the most prominent part
of the ear, the author advocates the following method in which the
notch is brought anterior to the fossa of the antihelix; in other words,
near to the point of the union of the helix with the skin of the face
about on a line with the superior border of the zygomatic process; a
point where the hair is in close proximity with the ear and where the
scar can be more easily covered.
The form of incision is somewhat sickle shaped, the upper
curvature of the incision following the inferior border of the helix and
extending well into the fossa of the helix, as shown in Fig. 136.
Where the antihelix is particularly large a triangular section may be
removed, as shown at A, with a corresponding shortening of the
helix flap at B. The latter gives more contour to the ear as well.

Fig. 136. Fig. 137.


Author’s Method.

The parts are brought together and sewn into position, as shown
in Fig. 137.

AURICULAR APPENDAGES
Small nipplelike projections of skin or elongated tumefactions of
connective tissue are sometimes found about the tragus, the lobule,
or on the neck. They are easily removed by encompassing their
bases with an elliptical incision and amputating them a little below
the level of the skin and suturing the wound in linear form.

POLYOTIA
Auricular appendages may contain small pieces of cartilage or
resemble crudely the auricle in miniature. This condition is termed
polyotia. One or more of these supernumerary ears may be found
anterior or posterior to the true ear or even below it on the skin of the
neck.
In the case reported by Wilde there were four ears, the two
abnormal ones being situated on the neck at either side. Langer has
reported a similar case. The condition may be unilateral or bilateral.
This congenital malformation is corrected by simple amputation,
as described under minor auricular appendages.

MALPOSITION OF THE AURICLE


The most common deformity met with in ears is undue
prominence. The ears stand out from the head at an obtuse angle,
often lopping forward and downward, giving the patient a stupid
appearance. This condition is usually inherited, but may be acquired
during childhood by the careless wearing of caps that crowd the
pinnæ forward and away from the head. The habit of ear-pulling is
also said to be a cause, also the faulty position of the head during
sleep. The deformity is usually bilateral, but in the majority of cases
one ear usually projects more than the other.
Where the deformity is recognized during infancy the ears should
be simply bandaged to the head with a suitable bandage or ear cap,
procurable for that purpose with the hope that the cartilages may
thus be influenced during their period of hardening and growth.
Invariably these patients are seen too late, and operative
procedures alone will restore the ears to their normal position.
The earlier in life such an operation is performed the more
satisfactory is the result, inasmuch as the cartilage of the ear is more
pliable, and hence more susceptible of readjustment; moreover, the
operation when done early in life necessitates only the removal of an
elliptical piece of skin from the back of the ear, according to Monks,
and suturing of the wound, as shown in Fig. 138.
The elliptical form of the incision must, however, be changed
according to the varied prominence of various parts of the ear. When
the ear lops forward, it should
be broader above and
narrower below, and vice versa
in the event when the concha
is overprominent.
When the patient is less than
fourteen or fifteen years of age
a general anesthetic should be
employed, but in older patients
the operation can be easily
undertaken under local use of
two-per-cent eucain solution.
Author’s Method.—The
method followed by the author
is to thoroughly anesthetize the
back of the ear, the patient
lying in a recumbent position Fig. 138.—Monks’ Method.
with the head to one side,
sufficient to place the ear to be operated upon in as convenient
position for operation as is possible. A rubber cap is drawn over the
head to cover the hair.
An incision is now made along the whole of the back of the ear as
far down as the sulcus, where the retro-aural integument joins that of
the neck.
The incision should involve the skin only, and vary from three
fourths to one half an inch from the outer border.
At once the blood will ooze from the line of incision. The operator
now presses the ear backward on the bare skin of the head, leaving
an imprint of the bleeding line on the skin there.
A second incision is made along this line, giving the total outlining
incision a heart-shaped form, as shown in Fig. 139.
The skin within this area is now dissected up quickly. There will be
more or less bleeding from the post-auricular vessels, which can
easily be controlled by sponge pressure, or with one or two artery
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebooknice.com

You might also like