100% found this document useful (1 vote)
27 views

Download full Using and Administering Linux Volume 1: From Zero to Linux Sysadmin Self-Study Both ebook all chapters

Linux

Uploaded by

kailaacitox4
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 (1 vote)
27 views

Download full Using and Administering Linux Volume 1: From Zero to Linux Sysadmin Self-Study Both ebook all chapters

Linux

Uploaded by

kailaacitox4
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 Version of textbook for Fast Typing at textbookfull.

com

Using and Administering Linux Volume 1: From Zero


to Linux Sysadmin Self-Study Both

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

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Using and Administering Linux: Volume 2 Zero to SysAdmin:


Advanced Topics Both

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

textboxfull.com

Linux+ and LPIC-1 Guide to Linux Certification, 5th


Edition Jason W. Eckert

https://textbookfull.com/product/linux-and-lpic-1-guide-to-linux-
certification-5th-edition-jason-w-eckert/

textboxfull.com

Mastering Linux Administration : Take your sysadmin skills


to the next level by configuring and maintaining Linux
systems 2nd Edition Alexandru Calcatinge & Julian Balog
https://textbookfull.com/product/mastering-linux-administration-take-
your-sysadmin-skills-to-the-next-level-by-configuring-and-maintaining-
linux-systems-2nd-edition-alexandru-calcatinge-julian-balog/
textboxfull.com

The Linux DevOps Handbook: Customize and scale your Linux


distributions to accelerate your DevOps workflow Wojs■aw

https://textbookfull.com/product/the-linux-devops-handbook-customize-
and-scale-your-linux-distributions-to-accelerate-your-devops-workflow-
wojslaw/
textboxfull.com
Mastering Linux Shell Scripting a practical guide to Linux
command line Bash scripting and Shell programming Ebrahim

https://textbookfull.com/product/mastering-linux-shell-scripting-a-
practical-guide-to-linux-command-line-bash-scripting-and-shell-
programming-ebrahim/
textboxfull.com

Kali Linux 2018 Windows Penetration Testing Conduct


network testing surveillance and pen testing on MS Windows
using Kali Linux 2018 2nd Edition Halton
https://textbookfull.com/product/kali-linux-2018-windows-penetration-
testing-conduct-network-testing-surveillance-and-pen-testing-on-ms-
windows-using-kali-linux-2018-2nd-edition-halton/
textboxfull.com

LPIC 1 Linux Professional Institute Certification Study


Guide Exam 101 500 and Exam 102 500 5th Edition Christine
Bresnahan
https://textbookfull.com/product/lpic-1-linux-professional-institute-
certification-study-guide-exam-101-500-and-exam-102-500-5th-edition-
christine-bresnahan/
textboxfull.com

Linux for Developers Jumpstart Your Linux Programming


Skills William "Bo" Rothwell

https://textbookfull.com/product/linux-for-developers-jumpstart-your-
linux-programming-skills-william-bo-rothwell/

textboxfull.com

Mastering Embedded Linux Programming - Second Edition:


Unleash the full potential of Embedded Linux with Linux
4.9 and Yocto Project 2.2 Chris Simmonds
https://textbookfull.com/product/mastering-embedded-linux-programming-
second-edition-unleash-the-full-potential-of-embedded-linux-with-
linux-4-9-and-yocto-project-2-2-chris-simmonds/
textboxfull.com
Using and
Administering
Linux: Volume 1
Zero to SysAdmin: Getting Started

David Both
Using and Administering
Linux: Volume 1
Zero to SysAdmin: Getting Started

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

ISBN-13 (pbk): 978-1-4842-5048-8 ISBN-13 (electronic): 978-1-4842-5049-5


https://doi.org/10.1007/978-1-4842-5049-5

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/9781484250488. 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: Introduction�������������������������������������������������������������������������������������������� 1
Objectives������������������������������������������������������������������������������������������������������������������������������������� 1
About Linux����������������������������������������������������������������������������������������������������������������������������������� 1
The birth of Windows�������������������������������������������������������������������������������������������������������������������� 3
Black box syndrome���������������������������������������������������������������������������������������������������������������� 3
The birth of Linux�������������������������������������������������������������������������������������������������������������������� 5
The open box��������������������������������������������������������������������������������������������������������������������������� 6
The Linux Truth������������������������������������������������������������������������������������������������������������������������������ 7
Knowledge������������������������������������������������������������������������������������������������������������������������������� 8
Flexibility��������������������������������������������������������������������������������������������������������������������������������� 9
Stability��������������������������������������������������������������������������������������������������������������������������������� 10
Scalability������������������������������������������������������������������������������������������������������������������������������ 11
Security��������������������������������������������������������������������������������������������������������������������������������� 11
Freedom�������������������������������������������������������������������������������������������������������������������������������� 12
Longevity������������������������������������������������������������������������������������������������������������������������������� 13
Should I be a SysAdmin?������������������������������������������������������������������������������������������������������������ 15
About this course������������������������������������������������������������������������������������������������������������������������ 17
About the experiments���������������������������������������������������������������������������������������������������������������� 18
What to do if the experiments do not work��������������������������������������������������������������������������������� 20
Terminology�������������������������������������������������������������������������������������������������������������������������������� 21

v
Table of Contents

How to access the command line����������������������������������������������������������������������������������������������� 21


Chapter summary����������������������������������������������������������������������������������������������������������������������� 22
Exercises������������������������������������������������������������������������������������������������������������������������������������� 22

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


Objectives����������������������������������������������������������������������������������������������������������������������������������� 23
Choice – Really!�������������������������������������������������������������������������������������������������������������������������� 23
What is an operating system?���������������������������������������������������������������������������������������������������� 24
Hardware������������������������������������������������������������������������������������������������������������������������������� 25
The operating system������������������������������������������������������������������������������������������������������������ 30
Typical operating system functions�������������������������������������������������������������������������������������������� 31
Memory management����������������������������������������������������������������������������������������������������������� 32
Multitasking��������������������������������������������������������������������������������������������������������������������������� 32
Multiuser������������������������������������������������������������������������������������������������������������������������������� 33
Process management������������������������������������������������������������������������������������������������������������ 34
Interprocess communication������������������������������������������������������������������������������������������������� 35
Device management�������������������������������������������������������������������������������������������������������������� 35
Error handling������������������������������������������������������������������������������������������������������������������������ 36
Utilities���������������������������������������������������������������������������������������������������������������������������������������� 36
A bit of history����������������������������������������������������������������������������������������������������������������������������� 37
Starting with UNICS��������������������������������������������������������������������������������������������������������������� 37
UNIX��������������������������������������������������������������������������������������������������������������������������������������� 38
A (very) brief history of Linux������������������������������������������������������������������������������������������������ 41
Core utilities�������������������������������������������������������������������������������������������������������������������������������� 41
GNU coreutils������������������������������������������������������������������������������������������������������������������������� 42
util-linux�������������������������������������������������������������������������������������������������������������������������������� 43
Copyleft��������������������������������������������������������������������������������������������������������������������������������� 44
Games����������������������������������������������������������������������������������������������������������������������������������������� 44
Chapter summary����������������������������������������������������������������������������������������������������������������������� 45
Exercises������������������������������������������������������������������������������������������������������������������������������������� 45

vi
Table of Contents

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


Objectives����������������������������������������������������������������������������������������������������������������������������������� 47
Background��������������������������������������������������������������������������������������������������������������������������������� 47
The structure of the philosophy�������������������������������������������������������������������������������������������������� 48
The tenets����������������������������������������������������������������������������������������������������������������������������������� 50
Data streams are a universal interface��������������������������������������������������������������������������������� 50
Transforming data streams��������������������������������������������������������������������������������������������������� 51
Everything is a file����������������������������������������������������������������������������������������������������������������� 52
Use the Linux FHS����������������������������������������������������������������������������������������������������������������� 52
Embrace the CLI�������������������������������������������������������������������������������������������������������������������� 53
Be the lazy SysAdmin������������������������������������������������������������������������������������������������������������ 54
Automate everything������������������������������������������������������������������������������������������������������������� 54
Always use shell scripts�������������������������������������������������������������������������������������������������������� 55
Test early test often��������������������������������������������������������������������������������������������������������������� 55
Use common sense naming�������������������������������������������������������������������������������������������������� 56
Store data in open formats���������������������������������������������������������������������������������������������������� 57
Use separate filesystems for data����������������������������������������������������������������������������������������� 58
Make programs portable������������������������������������������������������������������������������������������������������� 59
Use open source software����������������������������������������������������������������������������������������������������� 60
Strive for elegance���������������������������������������������������������������������������������������������������������������� 61
Find the simplicity����������������������������������������������������������������������������������������������������������������� 61
Use your favorite editor��������������������������������������������������������������������������������������������������������� 63
Document everything������������������������������������������������������������������������������������������������������������ 63
Back up everything – frequently������������������������������������������������������������������������������������������� 65
Follow your curiosity������������������������������������������������������������������������������������������������������������� 65
There is no should����������������������������������������������������������������������������������������������������������������� 66
Mentor the young SysAdmins������������������������������������������������������������������������������������������������ 67
Support your favorite open source project���������������������������������������������������������������������������� 67
Reality bytes�������������������������������������������������������������������������������������������������������������������������� 68
Chapter summary����������������������������������������������������������������������������������������������������������������������� 69
Exercises������������������������������������������������������������������������������������������������������������������������������������� 69

vii
Table of Contents

Chapter 4: Preparation������������������������������������������������������������������������������������������� 71
Objectives����������������������������������������������������������������������������������������������������������������������������������� 71
Overview������������������������������������������������������������������������������������������������������������������������������������� 71
Got root?������������������������������������������������������������������������������������������������������������������������������������� 72
Hardware specifications������������������������������������������������������������������������������������������������������������� 73
Host software requirements������������������������������������������������������������������������������������������������������� 74
Installing VirtualBox�������������������������������������������������������������������������������������������������������������������� 75
Install VirtualBox on a Linux host������������������������������������������������������������������������������������������ 75
Install VirtualBox on a Windows host������������������������������������������������������������������������������������� 82
Creating the VM��������������������������������������������������������������������������������������������������������������������������� 86
VirtualBox Manager��������������������������������������������������������������������������������������������������������������� 86
Configuring the virtual network��������������������������������������������������������������������������������������������� 88
Preparing disk space������������������������������������������������������������������������������������������������������������� 90
Download the ISO image file����������������������������������������������������������������������������������������������� 104
Creating the VM������������������������������������������������������������������������������������������������������������������� 105
Chapter summary��������������������������������������������������������������������������������������������������������������������� 114
Exercises����������������������������������������������������������������������������������������������������������������������������������� 115

Chapter 5: Installing Linux����������������������������������������������������������������������������������� 117


Objectives��������������������������������������������������������������������������������������������������������������������������������� 117
Overview����������������������������������������������������������������������������������������������������������������������������������� 117
Boot the Fedora live image�������������������������������������������������������������������������������������������������� 118
Installing Fedora����������������������������������������������������������������������������������������������������������������������� 123
Start the installation������������������������������������������������������������������������������������������������������������ 124
Set the hostname���������������������������������������������������������������������������������������������������������������� 125
Hard drive partitioning��������������������������������������������������������������������������������������������������������� 126
About swap space��������������������������������������������������������������������������������������������������������������� 136
Begin the installation���������������������������������������������������������������������������������������������������������������� 140
Set the root password��������������������������������������������������������������������������������������������������������� 141
Create the student user������������������������������������������������������������������������������������������������������� 143
Finishing the installation����������������������������������������������������������������������������������������������������������� 144
Exit the installer������������������������������������������������������������������������������������������������������������������� 144
viii
Table of Contents

Shut down the Live system������������������������������������������������������������������������������������������������������� 145


Reconfigure the VM������������������������������������������������������������������������������������������������������������� 146
Create a snapshot��������������������������������������������������������������������������������������������������������������������� 146
First boot����������������������������������������������������������������������������������������������������������������������������������� 148
What to do if the experiments do not work������������������������������������������������������������������������������� 149
Chapter summary��������������������������������������������������������������������������������������������������������������������� 151
Exercises����������������������������������������������������������������������������������������������������������������������������������� 151

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


Objectives��������������������������������������������������������������������������������������������������������������������������������� 153
Why Xfce����������������������������������������������������������������������������������������������������������������������������������� 153
The desktop������������������������������������������������������������������������������������������������������������������������� 154
The file manager����������������������������������������������������������������������������������������������������������������� 156
Stability������������������������������������������������������������������������������������������������������������������������������� 156
xfce4-terminal emulator������������������������������������������������������������������������������������������������������ 156
Configurability��������������������������������������������������������������������������������������������������������������������� 157
Getting started�������������������������������������������������������������������������������������������������������������������������� 157
Login����������������������������������������������������������������������������������������������������������������������������������������� 159
Exploring the Xfce desktop������������������������������������������������������������������������������������������������������� 162
Settings Manager���������������������������������������������������������������������������������������������������������������� 165
Adding launchers to Panel 2������������������������������������������������������������������������������������������������ 166
Preferred applications��������������������������������������������������������������������������������������������������������� 168
Desktop appearance����������������������������������������������������������������������������������������������������������������� 170
Appearance������������������������������������������������������������������������������������������������������������������������� 170
Multiple desktops���������������������������������������������������������������������������������������������������������������������� 173
Installing updates���������������������������������������������������������������������������������������������������������������������� 175
Chapter summary��������������������������������������������������������������������������������������������������������������������� 178
Exercises����������������������������������������������������������������������������������������������������������������������������������� 179

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


Objectives��������������������������������������������������������������������������������������������������������������������������������� 181
Introduction������������������������������������������������������������������������������������������������������������������������������� 181

ix
Table of Contents

Preparation������������������������������������������������������������������������������������������������������������������������������� 182
Defining the command line������������������������������������������������������������������������������������������������������� 183
CLI terminology������������������������������������������������������������������������������������������������������������������������� 183
Command prompt���������������������������������������������������������������������������������������������������������������� 184
Command line��������������������������������������������������������������������������������������������������������������������� 184
Command-line interface������������������������������������������������������������������������������������������������������ 184
Command���������������������������������������������������������������������������������������������������������������������������� 185
Terminal������������������������������������������������������������������������������������������������������������������������������� 185
Console�������������������������������������������������������������������������������������������������������������������������������� 187
Virtual consoles������������������������������������������������������������������������������������������������������������������� 188
Terminal emulator��������������������������������������������������������������������������������������������������������������� 195
Pseudo-terminal������������������������������������������������������������������������������������������������������������������ 196
Session�������������������������������������������������������������������������������������������������������������������������������� 197
Shell������������������������������������������������������������������������������������������������������������������������������������ 198
Secure Shell (SSH)�������������������������������������������������������������������������������������������������������������� 201
screen���������������������������������������������������������������������������������������������������������������������������������� 201
The GUI and the CLI������������������������������������������������������������������������������������������������������������������� 204
Some important Linux commands�������������������������������������������������������������������������������������������� 205
The PWD������������������������������������������������������������������������������������������������������������������������������ 206
Directory path notation styles��������������������������������������������������������������������������������������������� 206
Moving around the directory tree���������������������������������������������������������������������������������������� 207
Tab completion facility�������������������������������������������������������������������������������������������������������� 212
Exploring files���������������������������������������������������������������������������������������������������������������������� 214
More commands������������������������������������������������������������������������������������������������������������������ 217
Command recall and editing����������������������������������������������������������������������������������������������������� 220
Chapter summary��������������������������������������������������������������������������������������������������������������������� 223
Exercises����������������������������������������������������������������������������������������������������������������������������������� 223

Chapter 8: Core Utilities���������������������������������������������������������������������������������������� 225


Objectives��������������������������������������������������������������������������������������������������������������������������������� 225
GNU coreutils���������������������������������������������������������������������������������������������������������������������������� 225
util-linux������������������������������������������������������������������������������������������������������������������������������������ 230

x
Table of Contents

Chapter summary��������������������������������������������������������������������������������������������������������������������� 236


Exercises����������������������������������������������������������������������������������������������������������������������������������� 237

Chapter 9: Data Streams�������������������������������������������������������������������������������������� 239


Objectives��������������������������������������������������������������������������������������������������������������������������������� 239
Data streams as raw materials������������������������������������������������������������������������������������������������� 239
Text streams – A universal interface����������������������������������������������������������������������������������������� 241
STDIO file handles��������������������������������������������������������������������������������������������������������������������� 241
Preparing a USB thumb drive���������������������������������������������������������������������������������������������� 242
Generating data streams����������������������������������������������������������������������������������������������������������� 247
Test a theory with yes��������������������������������������������������������������������������������������������������������������� 250
Exploring the USB drive������������������������������������������������������������������������������������������������������������ 254
Randomness����������������������������������������������������������������������������������������������������������������������������� 261
Pipe dreams������������������������������������������������������������������������������������������������������������������������������ 262
Building pipelines��������������������������������������������������������������������������������������������������������������������� 264
Redirection�������������������������������������������������������������������������������������������������������������������������������� 265
Just grep’ing around����������������������������������������������������������������������������������������������������������������� 268
Cleanup������������������������������������������������������������������������������������������������������������������������������������� 269
Chapter summary��������������������������������������������������������������������������������������������������������������������� 270
Exercises����������������������������������������������������������������������������������������������������������������������������������� 271

Chapter 10: Text Editors��������������������������������������������������������������������������������������� 273


Objectives��������������������������������������������������������������������������������������������������������������������������������� 273
Why we need text editors��������������������������������������������������������������������������������������������������������� 273
Vim�������������������������������������������������������������������������������������������������������������������������������������������� 275
Other editors����������������������������������������������������������������������������������������������������������������������������� 276
Emacs���������������������������������������������������������������������������������������������������������������������������������� 276
gedit������������������������������������������������������������������������������������������������������������������������������������ 276
Leafpad�������������������������������������������������������������������������������������������������������������������������������� 277
Kate������������������������������������������������������������������������������������������������������������������������������������� 277
xfw��������������������������������������������������������������������������������������������������������������������������������������� 277
xed��������������������������������������������������������������������������������������������������������������������������������������� 277

xi
Table of Contents

Learning Vim����������������������������������������������������������������������������������������������������������������������������� 277


Disabling SELinux���������������������������������������������������������������������������������������������������������������� 278
Use your favorite text editor������������������������������������������������������������������������������������������������������ 280
Chapter summary��������������������������������������������������������������������������������������������������������������������� 281
Exercises����������������������������������������������������������������������������������������������������������������������������������� 281

Chapter 11: Working As Root�������������������������������������������������������������������������������� 283


Objectives��������������������������������������������������������������������������������������������������������������������������������� 283
Why root?���������������������������������������������������������������������������������������������������������������������������������� 283
More about the su command���������������������������������������������������������������������������������������������������� 284
Getting to know the root account���������������������������������������������������������������������������������������������� 286
Disadvantages of root��������������������������������������������������������������������������������������������������������������� 292
Escalating user privilege����������������������������������������������������������������������������������������������������������� 293
The bad ways���������������������������������������������������������������������������������������������������������������������� 293
Using sudo��������������������������������������������������������������������������������������������������������������������������� 293
Using su as root������������������������������������������������������������������������������������������������������������������������ 305
Chapter summary��������������������������������������������������������������������������������������������������������������������� 306
Exercises����������������������������������������������������������������������������������������������������������������������������������� 306

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


Objectives��������������������������������������������������������������������������������������������������������������������������������� 309
Dependency hell������������������������������������������������������������������������������������������������������������������ 309
RPM������������������������������������������������������������������������������������������������������������������������������������������� 310
YUM������������������������������������������������������������������������������������������������������������������������������������������� 315
DNF������������������������������������������������������������������������������������������������������������������������������������������� 316
Installing packages�������������������������������������������������������������������������������������������������������������� 317
Installing updates���������������������������������������������������������������������������������������������������������������� 320
Post-update tasks��������������������������������������������������������������������������������������������������������������� 323
Removing packages������������������������������������������������������������������������������������������������������������ 324
Groups��������������������������������������������������������������������������������������������������������������������������������������� 326
Adding repositories������������������������������������������������������������������������������������������������������������������� 327

xii
Table of Contents

About the kernel������������������������������������������������������������������������������������������������������������������������ 330


Chapter summary��������������������������������������������������������������������������������������������������������������������� 332
Exercises����������������������������������������������������������������������������������������������������������������������������������� 332

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


Objectives��������������������������������������������������������������������������������������������������������������������������������� 335
The art of problem solving�������������������������������������������������������������������������������������������������������� 336
The five steps of problem solving���������������������������������������������������������������������������������������� 336
Knowledge��������������������������������������������������������������������������������������������������������������������������� 337
Observation������������������������������������������������������������������������������������������������������������������������� 338
Reasoning���������������������������������������������������������������������������������������������������������������������������� 339
Action���������������������������������������������������������������������������������������������������������������������������������� 340
Test�������������������������������������������������������������������������������������������������������������������������������������� 340
System performance and problem solving������������������������������������������������������������������������������� 341
top��������������������������������������������������������������������������������������������������������������������������������������� 342
Other top-like tools������������������������������������������������������������������������������������������������������������������� 358
htop������������������������������������������������������������������������������������������������������������������������������������� 359
atop������������������������������������������������������������������������������������������������������������������������������������� 361
More tools��������������������������������������������������������������������������������������������������������������������������������� 364
Memory tools����������������������������������������������������������������������������������������������������������������������� 364
Tools that display disk I/O statistics������������������������������������������������������������������������������������ 366
The /proc filesystem����������������������������������������������������������������������������������������������������������������� 369
Exploring hardware������������������������������������������������������������������������������������������������������������������� 372
Monitoring hardware temperatures������������������������������������������������������������������������������������������ 374
Monitoring hard drives�������������������������������������������������������������������������������������������������������� 377
System statistics with SAR������������������������������������������������������������������������������������������������������� 386
Installation and configuration���������������������������������������������������������������������������������������������� 386
Examining collected data���������������������������������������������������������������������������������������������������� 386
Cleanup������������������������������������������������������������������������������������������������������������������������������������� 391
Chapter summary��������������������������������������������������������������������������������������������������������������������� 392
Exercises����������������������������������������������������������������������������������������������������������������������������������� 393

xiii
Table of Contents

Chapter 14: Terminal Emulator Mania������������������������������������������������������������������ 395


Objectives��������������������������������������������������������������������������������������������������������������������������������� 395
About terminals������������������������������������������������������������������������������������������������������������������������� 395
My requirements����������������������������������������������������������������������������������������������������������������������� 396
rxvt�������������������������������������������������������������������������������������������������������������������������������������� 398
xfce4-terminal��������������������������������������������������������������������������������������������������������������������� 398
LXTerminal��������������������������������������������������������������������������������������������������������������������������� 402
Tilix�������������������������������������������������������������������������������������������������������������������������������������� 404
Konsole�������������������������������������������������������������������������������������������������������������������������������� 410
Terminator��������������������������������������������������������������������������������������������������������������������������� 412
Chapter summary��������������������������������������������������������������������������������������������������������������������� 415
Exercises����������������������������������������������������������������������������������������������������������������������������������� 415

Chapter 15: Advanced Shell Topics���������������������������������������������������������������������� 417


Objectives��������������������������������������������������������������������������������������������������������������������������������� 417
The Bash shell��������������������������������������������������������������������������������������������������������������������������� 418
Shell options����������������������������������������������������������������������������������������������������������������������������� 418
Shell variables��������������������������������������������������������������������������������������������������������������������������� 420
Commands�������������������������������������������������������������������������������������������������������������������������������� 421
The PATH����������������������������������������������������������������������������������������������������������������������������� 422
Internal commands�������������������������������������������������������������������������������������������������������������� 424
External commands������������������������������������������������������������������������������������������������������������� 427
Forcing the use of external commands������������������������������������������������������������������������������� 428
Compound commands�������������������������������������������������������������������������������������������������������������� 429
Time-saving tools���������������������������������������������������������������������������������������������������������������������� 433
Brace expansion������������������������������������������������������������������������������������������������������������������ 433
Special pattern characters�������������������������������������������������������������������������������������������������� 435
Sets������������������������������������������������������������������������������������������������������������������������������������� 438
Meta-characters������������������������������������������������������������������������������������������������������������������ 440
Using grep��������������������������������������������������������������������������������������������������������������������������������� 440
Finding files������������������������������������������������������������������������������������������������������������������������������ 445

xiv
Table of Contents

Chapter summary��������������������������������������������������������������������������������������������������������������������� 448


Exercises����������������������������������������������������������������������������������������������������������������������������������� 448

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


Objectives��������������������������������������������������������������������������������������������������������������������������������� 451
Overview����������������������������������������������������������������������������������������������������������������������������������� 451
Hardware boot�������������������������������������������������������������������������������������������������������������������������� 452
Linux boot��������������������������������������������������������������������������������������������������������������������������������� 453
GRUB����������������������������������������������������������������������������������������������������������������������������������� 454
Configuring GRUB���������������������������������������������������������������������������������������������������������������� 464
The Linux kernel������������������������������������������������������������������������������������������������������������������ 470
Linux startup����������������������������������������������������������������������������������������������������������������������������� 471
systemd������������������������������������������������������������������������������������������������������������������������������� 471
Graphical login screen��������������������������������������������������������������������������������������������������������� 478
About the login�������������������������������������������������������������������������������������������������������������������������� 487
CLI login screen������������������������������������������������������������������������������������������������������������������� 487
GUI login screen������������������������������������������������������������������������������������������������������������������ 488
Chapter summary��������������������������������������������������������������������������������������������������������������������� 489
Exercises����������������������������������������������������������������������������������������������������������������������������������� 490

Chapter 17: Shell Configuration���������������������������������������������������������������������������� 491


Objectives��������������������������������������������������������������������������������������������������������������������������������� 491
Starting the shell����������������������������������������������������������������������������������������������������������������������� 492
Non-login shell startup�������������������������������������������������������������������������������������������������������� 495
Login shell startup��������������������������������������������������������������������������������������������������������������� 495
Exploring the global configuration scripts��������������������������������������������������������������������������� 496
Exploring the local configuration scripts����������������������������������������������������������������������������� 499
Testing it������������������������������������������������������������������������������������������������������������������������������ 500
Exploring the environment�������������������������������������������������������������������������������������������������������� 504
User shell variables������������������������������������������������������������������������������������������������������������� 505

xv
Table of Contents

Aliases�������������������������������������������������������������������������������������������������������������������������������������� 508
Chapter summary��������������������������������������������������������������������������������������������������������������������� 510
Exercises����������������������������������������������������������������������������������������������������������������������������������� 510

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


Objectives��������������������������������������������������������������������������������������������������������������������������������� 513
Introduction������������������������������������������������������������������������������������������������������������������������������� 514
Preparation������������������������������������������������������������������������������������������������������������������������������� 514
User accounts and security������������������������������������������������������������������������������������������������������ 516
File attributes���������������������������������������������������������������������������������������������������������������������������� 517
File ownership��������������������������������������������������������������������������������������������������������������������� 517
File permissions������������������������������������������������������������������������������������������������������������������ 520
Directory permissions��������������������������������������������������������������������������������������������������������� 522
Implications of Group ownership����������������������������������������������������������������������������������������� 522
umask���������������������������������������������������������������������������������������������������������������������������������� 527
Changing file permissions��������������������������������������������������������������������������������������������������� 529
Applying permissions���������������������������������������������������������������������������������������������������������� 531
Timestamps������������������������������������������������������������������������������������������������������������������������� 532
File meta-structures����������������������������������������������������������������������������������������������������������������� 533
The directory entry�������������������������������������������������������������������������������������������������������������� 533
The inode����������������������������������������������������������������������������������������������������������������������������� 533
File information������������������������������������������������������������������������������������������������������������������������� 533
Links����������������������������������������������������������������������������������������������������������������������������������������� 536
Hard links���������������������������������������������������������������������������������������������������������������������������� 537
Chapter summary��������������������������������������������������������������������������������������������������������������������� 546
Exercises����������������������������������������������������������������������������������������������������������������������������������� 546

Chapter 19: Filesystems��������������������������������������������������������������������������������������� 549


Objectives��������������������������������������������������������������������������������������������������������������������������������� 549
Overview����������������������������������������������������������������������������������������������������������������������������������� 549
Definitions��������������������������������������������������������������������������������������������������������������������������������� 550
Filesystem functions����������������������������������������������������������������������������������������������������������������� 551

xvi
Table of Contents

The Linux Filesystem Hierarchical Standard����������������������������������������������������������������������������� 553


The standard����������������������������������������������������������������������������������������������������������������������� 553
Problem solving������������������������������������������������������������������������������������������������������������������� 556
Using the filesystem incorrectly������������������������������������������������������������������������������������������ 556
Adhering to the standard����������������������������������������������������������������������������������������������������� 557
Linux unified directory structure����������������������������������������������������������������������������������������������� 557
Filesystem types����������������������������������������������������������������������������������������������������������������������� 559
Mounting����������������������������������������������������������������������������������������������������������������������������������� 561
The Linux EXT4 filesystem�������������������������������������������������������������������������������������������������������� 562
Cylinder groups������������������������������������������������������������������������������������������������������������������� 563
The inode����������������������������������������������������������������������������������������������������������������������������� 569
Journal�������������������������������������������������������������������������������������������������������������������������������� 570
Data allocation strategies��������������������������������������������������������������������������������������������������������� 572
Data fragmentation�������������������������������������������������������������������������������������������������������������� 573
Repairing problems������������������������������������������������������������������������������������������������������������������� 578
The /etc/fstab file���������������������������������������������������������������������������������������������������������������� 578
Repairing damaged filesystems������������������������������������������������������������������������������������������ 585
Creating a new filesystem�������������������������������������������������������������������������������������������������������� 594
Finding space���������������������������������������������������������������������������������������������������������������������� 595
Add a new virtual hard drive����������������������������������������������������������������������������������������������� 596
Other filesystems���������������������������������������������������������������������������������������������������������������������� 604
Chapter summary��������������������������������������������������������������������������������������������������������������������� 606
Exercises����������������������������������������������������������������������������������������������������������������������������������� 606

Bibliography��������������������������������������������������������������������������������������������������������� 609
Books���������������������������������������������������������������������������������������������������������������������������������������� 609
Web sites���������������������������������������������������������������������������������������������������������������������������������� 610

Index��������������������������������������������������������������������������������������������������������������������� 615

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 five-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, much 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 the first two volumes and part of the third volume 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 1 – Zero to
SysAdmin: Getting Started. 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 – which 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, 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 have 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.

Content 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 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. Using 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 and Updating 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, which 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 and
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, which 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 e-mail 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 e-mail 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 E-mail

8. E-mail 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
Another Random Scribd Document
with Unrelated Content
covering of verdant trees and shrubs, swarming in wild profusion, the
hand of man having in few places contributed its aid.
“Hail, Source of beings! Universal Soul
Of Heav’n and Earth! Essential Presence, hail!
To Thee I bend the knee: to Thee my thoughts
Continual climb, who with a master hand
Hast the great whole into perfection touch’d.”

This charming picture is lost to view on passing the opening


betwixt the pillars, where the prospect, although more confined, is
admirable, consisting of the deep recesses of the Orange Valley, the
more lofty features of the mountains which encompass it, and the
singularly formed Corcovada at its head, all rising into indescribable
magnificence. These are scenes that would have delighted and
invigorated with new energy the most exalted poets and painters.
From hence, a narrower terrace, covered with entwining brushwood,
and skirting along the side of the mountains for about a mile, brought
us to the head of the valley, where the origin of the aqueduct is
marked, by an inscription, to have taken place in the year 1744. Its
source is adorned with a fine cascade, at the foot of which, a
declining platform of rocks, overshadowed with trees, and refreshed
with the falling water, afforded us a delightful retreat from the rays of
the sun; and here in reality we enjoyed the refreshment a slave had
brought for us: above us the rugged mountains in precipices and the
stony bed of the rivulet were seen, overhung with high trees and
shrubs as far as the eye could reach. In this place, and from these
waters, a poetical mind must, indeed, imbibe those draughts of
inspiration which the vale of Tempe, and the mountain and stream of
Parnassus are fabled to have produced. A long and intricate path
leads from hence to the summit of the Corcovada Mountain; below
us there was an abrupt and rocky steep, its sides covered with
thickly growing brushwood, down which the water descended in a
murmuring course to the valley; the whole of its varieties of verdure
and fertility, with the bay of Bota-fogo at its lower extremity, was
within our view. A winding road led us to a point, where we
descended by a difficult way into the valley, while its fine oranges,
growing spontaneously, supplied us with a dessert. It is beautified
with some elegant houses, of one of which, at the bottom, almost
opposite to the Queen’s cottage, the accompanying sketch is a
specimen. Our way from hence continued by the Cateta and the
Gloria to Rio.

PILLARS NEAR THE SOURCE OF THE AQUEDUCT


On Stone by C. Shoosmith from a Sketch by Jas. Henderson.
Printed by C. Hullmandel.
HOUSE AT THE BOTTOM OF THE ORANGE VALLEY.
The open spaces of the city, denominated squares, consist of the
Palace Square, one hundred and fifty yards long, and eighty wide,
with two good landing stairs from the bay; of the Roceo, one hundred
and eighty yards long, and one hundred wide; and the Capim,
recently called Peloirinho. In the Cidado Nova, there is one which
occupies the intermediate space of the crossing of four streets; but,
although these are open spaces, they have little regularity or
semblance to any thing that produces the idea of a square. The
Royal Palace which has more the appearance of a manufactory than
the residence of a king, is composed of that formerly occupied by the
viceroys, the convent of the Carmelites, and the senate-house,
united by passages, the first forming the southern side of the square,
and the latter the western. The northern side consists of a row of
houses, which are private property, with two stories the same as the
others. The first portion has twenty-four windows on the side, and
nine in front towards the bay, the lower part of which is occupied by
the guards and some public offices, the rooms above are generally
used by the King for public levees. Some of the merchants and
groups of the male inhabitants frequent every evening that part of
the square, and the walls adjoining the landing places and bordering
the bay afford convenient seats, which are fully occupied. Here the
arrival of vessels is ascertained, and the sea-breeze enjoyed.
The mint, the armory, the naval arsenal, and that of the military,
(called trem,) and the custom house, are the principal public
buildings; but of themselves present nothing particularly worthy of
remark. There are various public trapiches, or warehouses for the
deposit of produce. The public gardens, which are stated by some
travellers to have been fully and gaily attended some twelve or
fourteen years ago, are now quite unfrequented, and sunk into
neglect. This place of resort in former times consists of about two
acres of ground, bordering upon the bay, enclosed with a high wall,
and neatly laid out in walks of trees, overhung with a variety of
evergreen foliage. There is a stone terrace at the end, ascended by
two flights of steps, commanding a view of the bay, with the remains
of two pavilions, and other mutilated objects. This place is not left
without regret, that so cool and agreeable a situation, and so well
calculated for a public promenade, is permitted to fall into decay. For
the administration of justice the same tribunals exist here as at
Lisbon. At the period of the suppression of the board of inspection, in
1808, was created the tribunal of the royal junta of commerce,
agriculture, manufactures, and navigation, composed of ten
deputies, a president, a secretary, and an official maior, (officiating
mayor.) The Jesuitical library is open to the public; it contains about
sixty thousand volumes, amongst which there are but few modern
works, and a great many old ones on theology. I was in the habit of
frequenting it, and as is the custom at the national library in Paris,
the librarian attends, immediately brings any book that may be
required, and places it upon a small reading desk on the table, with
which each person is accommodated. The very small number who
attended consisted generally of priests and friars. Manufactories
have yet acquired no footing in this city; there is however, one of sail-
cloth, and another of silk stockings; also, a few miles distant, at
Andrahi, there are works for printing cottons upon a small scale, and
conducted by a person who has been in England. Coarse cottons
are manufactured in the interior of Brazil, and they pass the shuttle
with the hand, according to the mode used in England formerly.
The only place of amusement in Rio is the theatre, erected within
the last few years, and which, in point of external appearance, is
beyond mediocrity. It contains four tiers of boxes on each side of the
house, thirteen in each tier, making, in the whole, one hundred and
four boxes, which are extremely gloomy, being shut in at the sides.
The royal box occupies the whole of the space fronting the stage,
above which there is a small gallery; and the pit contains about four
hundred persons. The orchestra is esteemed very tolerable; but the
performances are indifferent. Two French dancers and their wives
are at present the magnets of attraction; and there is great emulation
between them for the palm of superiority. The Campo St. Anna
contains a large building, erected for the purpose of bull-baiting; but
the Brazilian bull not possessing the fire and fury of this animal in
Europe, was the reason of its falling into disuse, and creditable
would it be if so irrational and cruel an amusement was discontinued.
Within the last two years, this building was the scene of the various
feats in horsemanship of Mr. Southby and his troop, for which it is
well adapted. The clown, soon acquiring some of the local
peculiarities of the people, produced amongst them a fund of
merriment they had been little accustomed to; and they expressed
themselves more highly astonished and pleased with those
performances, and the wonderful display of agility by Mrs. Southby
on the tight rope, than any thing they had ever before witnessed.
The city of Rio de Janeiro was taken by the French, in the year
1711, under M. Duguay Truin, and afterwards recovered by the
people. In the preceding year, M. du Clerc had entered the town,
conducted by two fugitive negroes, from Ilha Grande.
There are three principal roads leading from this city, none of
which are adapted to the use of a carriage for more than six or seven
miles. The first, leading to the southward, after passing the public
gardens and the Lapa, proceeds, for a short distance, along the
banks of the bay, commanding a view of its entrance, which is soon
interrupted by the Gloria Hill, behind which the road passes, and
continues in a parallel line with the Pria Flemingo, which is adorned
with several neat houses, many of them occupied by English
merchants. The Hon. Mr. Thornton had taken up a temporary
residence in one of them. After crossing a small bridge at the Cateta,
the road conducts, for about a mile and a half, betwixt luxuriant and
verdant hedges, to the beach or Pria of Bota-fogo, which is a fine
bay, shut in by picturesque promontories and headlands, leaving
only a narrow channel for the ingress and egress of its waters. This
beach is edged with some of the neatest and most elegant houses in
the vicinity of Rio de Janeiro, many of them occupied by fidalgos,
and others by English merchants; one of which, in the possession of
Mr. Harrison, exhibits all the beauty, elegance, and comfort of an
English villa. Bye-roads lead from hence to the Pria Vermelha, to the
royal powder manufactory, and the botanical garden already
mentioned. In many parts the Cateta road is in a very bad state of
repair, and the holes and hollow places form pools of water after the
least fall of rain. The other two roads lead to the north of the city,
both branching from the Campo St. Anna, and again communicate in
passing Matta Porcas. The first and principal one proceeds from the
right of the Campo, and continues for about a mile and a half, to the
wooden bridge of St. Diogo, across a marshy flat, which eight or ten
years ago was impassable, and is now denominated the Cidade
Nova, of which it may in time constitute a portion. The road of the
Cidade Nova, being the daily route of the royal family, is kept in
pretty good order, as well as the whole road as far as the palace of
Christovao, which at Matta Porcas turns to the right, and continues
for about two miles along a level, with amphitheatres of various and
picturesque mountains in every direction. After crossing the third
brook, by a small bridge, the way to the palace turns to the left, when
a handsome entrance is discovered, not in unison with the palace,
but consisting of a wall and iron palisades, extending about thirty
yards on each side of it, without any contiguous lodge or building.
From hence the road sweeps to the left, up a gentle acclivity, to the
eminence upon which the palace stands, fronted by a square, not
embellished with shrubs and grass-plots, but of deep sand, which is
entered by the left corner, and not by the grand entrance, composed
of the elegant gates, a counterpart of those at Sion House, and sent
as a present to his Majesty by the Duke of Northumberland. They
are placed in the centre betwixt pillars of granite, peculiar to the
country, and two lodges, the remainder on each side along the whole
front of the palace being completed with palisades of Portuguese
workmanship. It will excite some surprise in the reader to be
informed, that the outer part, which should form a road to this
entrance, is allowed to remain in its natural state of hollow and
uneven ground, when no very great labour would be required to
render it complete. At present, the gates are in disuse, the lodges
closed, and, with the aid of the dirt and gunpowder arising from the
fire-works ranged along their front, on occasions of religious
festivals, the whole already appears in a course of dilapidation. The
palace is one story high, perfectly plain, without any pretensions to
elegance, or the semblance of any order of architecture, and can
boast of nothing but the beauty of its situation. It might, indeed, be
mistaken, at a distance, for a manufactory, in consequence of the
windows being so crowded together, and particularly at night, when it
is lighted up.
The road, from the point which leads to the palace, continues by
either turning a little further on to the left, and ascending a hill, or by
the Campo St. Christovao, which sweeps round the hill and meets
the other road on the opposite side, and afterwards leads on to the
province of St. Paulo and Minas Geraes. It is the grand track of the
miners and others coming from distant districts, and presents
successive troops of mules, laden with different produce, attached to
their curious and rudely constructed pack-saddles, by straps of raw
hides.
The road of St. Christovao and the Cidade Nova, are generally
crowded by these caravans, their drivers of all complexions, dressed
in cotton shirts and trowsers, with slouching hats, and combined with
the horses and mules, carrying persons of rather a superior order
coming also from the interior, amount to the aggregate number of at
least two thousand passing and re-passing daily. It would be difficult
to describe the variety of costume and rude appearance of the latter
persons, many of whom are dressed in black or dirty white hats, with
prodigious rims, a capote, or cloak, frequently of sky-blue, thrown
round the front part of the body, and being crossed behind them,
hangs in folds on each side of the mule. The bits of their bridles, their
saddles, and stirrups, are of various antiquated and fantastic shapes.
Some wear boots of brown leather, closely fitted to the leg, bound
round the top with a strap and large buckle; others with capotes,
large hats, &c. wear neither shoes nor boots, but introduce the great
toes only into the stirrups, and with large heavy spurs upon the
naked heels, are not the least remarkable among these burlesque
figures. I have frequently ridden with them, and always found that
they were communicative and civil. Their mules, which had
performed journeys of two and three months, did not appear to have
sustained much injury. These people mostly frequent certain streets
in the city for disposal of their produce, and the purchase of
manufactured goods. The Rua de Candelaria is the great mart for
cheeses, brought from the interior. The Rua de Violas, Rua de St.
Pedro, &c. are visited by the miners; and some of the shopkeepers,
of whom they buy their return cargo, occasionally purchase from the
English merchants three or four thousand pounds of goods in one
bargain.
The other road leading from the Campo St. Anna, does not
present so much traffic as the last, and is denominated the old road.
It proceeds through the village of Catimby, and from thence to Matta
Porcas, one end of which it passes, and advances through the
valley, having many good houses by its sides, to Andrahi, contracting
afterwards betwixt the mountains into a narrow bridle way, leading to
the district of Tejuco. From this road, near the Pedro Mountain, a
cross road, with some good houses, the principal one recently
occupied by Mr. Gill, an English merchant, conducts through the
extremity of the valley of Engenho Velho, and at a distance of about
half a mile unites itself with a road coming through another portion of
the same valley, from the stone bridge near the turn to the palace.
After this junction, the road proceeds through the valley of Engenho
Novo, and communicates with the great road to the mines.
The road which turns off at the stone bridge last mentioned is a
lane much frequented by the royal family, and is bounded by
beautifully verdant hedges, and some neat shacaras, and is not
dissimilar in appearance to the green lanes, leading from London to
Southgate. It is the limit of the King’s shacara on the right. About
three quarters of a mile from its commencement is situated the Casa
de Don Pedro, recently erected in the form of a castle, with a flag-
staff at the top, the ground-floor consisting of one good sized room,
and four smaller, covered with India matting, and furnished with
chairs and sofas, but by no means in a royal style. From the palace
to this casa is a favourite walk of the King’s; the interval forms the
royal shacara, and is laid out in walks, crossing each other at right
angles, shaded by an abundant variety of trees, which have been
planted only within the last few years, and demonstrate by their state
of maturity, the exuberant fertility of the soil and climate.
The road continues from hence, across a brook, by a wooden
bridge, which bounds the King’s shacara on that side; and very near
to it is the royal mill, which is yet far from being completed, although
it was begun five or six years ago. It is intended to have one water-
wheel and four pair of mill-stones. The model of the building and the
machinery were sent from Lisbon. When the mill is finished, it is
expected to grind forty sacks of wheat during the day and night, for
which the public will be charged two crusades (about five shillings)
per sack, of three alqueiras, or about three and a half of Winchester
bushels.
One hundred yards further is situated Bella-fonta, the fine
shacara of Mr. Wright, under whose roof I received every kindness
and hospitality possible, during my residence at Rio; and am happy
in this opportunity of acknowledging, in common with all who know
him, the high estimation I entertain of his character.
Within the circuit of the roads described, the valley of Engenho
Velho is adorned with numerous neat shacaras, abounding with
walks formed of oranges, and all the fruit trees of the tropics. Many
give the preference to a residence on the Cateta side; but, in
consequence of the royal family frequenting this quarter, I think the
spirit of improvement shows itself more decidedly in this direction,
and although the sea breezes do not reach it, the land breezes from
the adjacent mountains, sweeping along the valley, render the
mornings and evenings particularly delightful. The dews are here
profuse.

On Stone by G. Hurley; the figures by Shoosmith from a Sketch by Jas.


Henderson.
Printed by Romney & Fayter.
A Pedlar & His Slave.
BELLA FONTA, THE SHACARA OF I.E. WRIGHT, ESCa.
On Stone by C. Shoosmith from a Sketch by Jas. Henderson.
Printed by C. Hullmandel.
PALACE OF ST CRISTOVÃO.

I accompanied a gentleman, in the month of September, to see


the Casa de Don Pedro, from whence we proceeded along the
delightfully shaded walks of the shacara to the palace, which is in the
progress of augmentation by some buildings under the inspection of
Mr. Johnson, who came to the Brazil with the gates from the Duke of
Northumberland, and who has been since employed by the King in
superintending the progressive enlargement of the palace. On this
day, all bands were fully employed in finishing a suite of rooms which
his Majesty had a great wish to occupy that evening.
On descending a hill from the palace, we perceived Prince Don
Miguel in a field below, dressed in a pair of great jack-boots, a
cocked hat, and a star upon his breast, with a pole about 10 feet
long in his hand, attending a plough with one handle, drawn by six
bullocks, followed by five or six negro drivers and a feitor.[12] They
executed their work very imperfectly, allowing the greatest portion of
the turf to fall down again. From the superfluity of animal power
employed in this defective specimen of agriculture, our attention was
directed to the royal stables, which contained about three hundred
mules and horses of a diminutive size, with double the number of
persons to look after them that would have been deemed necessary
in England.
Prince Don Pedro had been breaking horses into harness all that
morning, and we met him with the fourth pair; he used a large
unwieldy whip, which, however, he administered pretty freely, making
as much noise as a French postilion would, on announcing his arrival
at a town, by the cracking of his whip. On passing him we stood still
and took off our hats, which was only returned by an ungracious
look. We also met Prince Don Miguel, returning from his agricultural
amusement, accompanied by his feitor. He is a spare and pale-
looking person, about sixteen years of age. Passing close to his
elbow, we paid him the most respectful obeisance, but we were not
honoured even with the least inclination of his head.
I walked one evening to see the fire-works, which had been
preparing for some time for the celebration of a saint’s day, in front of
the palace, ranged along, and a few yards distant from the gates and
palisades. The veranda was filled with a great many priests and
friars, and others about the person of the King. His Majesty and the
rest of the family took their station at the fifth window, on the right of
the handsome flight of stairs erected by Mr. Johnson. The fire-works
were ill executed, and could not be put in comparison with such
exhibitions in Europe, which is much to be wondered at, considering
the immense revenue here annually expended in this way, and the
great number of persons that live by it and follow no other pursuit.
Every evening at eight o’clock, excepting holidays and Sundays, the
King receives the public, in a room appropriated for the purpose, at
St. Christovao, to the honour of beija-māo;[13] and the roads of
Cidade Nova, Catimby, and Matta Porcas are covered, on those
occasions, with officers, and numerous persons in cabriolets, on
horseback, and on foot, pressing towards the palace, consisting of
those who have some object to carry with his Majesty. When the
door is opened there is a promiscuous rushing forward, and a
mulatto will be seen treading upon the heels of a general. They
advance in single rank up one side of the room to the upper part,
where his Majesty is seated, attended by his fidalgos in waiting, and,
passing him in review, they countermarch in the same order. It is
said that the King has an extraordinary memory, and recollects each
individual as he passes, and the object of his visit; those who please
speak to him, but a great proportion do not. It would appear that his
Majesty is partial to seeing people in this way for a considerable
period before he concedes what they want. A gentleman from Lisbon
informed me that he had come to Rio expressly to gain some object
with the government, and he anticipated a residence of twelve
months there before he accomplished it. He purposed omitting none
of those numerous attendances of beija-māo, unless his neglecting
to do so might be observed by his Majesty; who, he observed was
particularly desirous of detaining all Europeans there as long as
possible. Senhor Thomas Antonio de Portugal, the minister of state,
who has a shacara upon the left side of the road, already described,
leading to Andrahi, holds a sort of public levee two days in each
week, where crowds of officers and others attend, to submit their
applications or to solicit his patronage, afterwards proceeding to
perform the accustomed ceremony of beija-māo at the palace,
during which period, from eight to nine o’clock, a band of music, in
no very harmonious strains, is heard through a portion of the valley.
The fidalgos, and those who may be denominated the higher
orders of society here, are infinitely behind corresponding classes in
the leading states of Europe, both in the knowledge and practice of
civilized life. The pleasures and refinements of social intercourse are
alike unknown to them: jealous of foreigners, their conduct towards
them is not marked by that attention or hospitality so conspicuous in
other countries, where the cultivation of a liberal system of society
prevails. Their main occupation consists in outward show, in the
punctilious observance of court-etiquette, and a regular attendance
upon the superstitious rites and festivals of the Catholic religion.
Whatever little exists of pomp and splendour in this city is to be
discovered in the temples, which are fitted up with rich profusion,
more especially the parish churches, their altars and shrines
exhibiting decorations of the most costly kind, in which respect St.
Sebastian, or the Royal Chapel, stands pre-eminent; its richly-gilded
walls, carved work, and splendidly-ornamented altars, glittering with
a profusion of gold, silver, and precious stones, surpass in brilliancy
any thing that could be imagined, by a plain Christian, as essential to
the purposes of divine worship. The chapel has some paintings, and
one large piece over the chief altar, into which the late Queen and
the principal part of the royal family are introduced. The King has a
large box, not unlike an opera-box, above the place where grand
mass is performed; here his Majesty and the rest of the family take
their seats on festival-days; the bishop, in white or yellow satin, richly
embroidered with gold, his mitre of the same, sits in great state
below, opposite to the King, when he is not engaged in any part of
the ceremony, in which he is assisted by a prodigious number of
padres, and the service is performed with vast magnificence. The
organ, accompanied by a crowd of vocal performers, amongst whom
are five or six eunuchs, gratify, with some of the finest music of the
Brazil, the audience, consisting, on some occasions, of many
fidalgos, judges, ministers, and various individuals, who, in their
gaudy robes, sit upon benches along the body of the chapel. There
are others also who are led there by curiosity.
Here the King will sometimes spend the whole day, and, upon the
celebration of some favourite saint’s day, will remain till midnight.
These holidays and festivities are usually attended by an immense
consumption of gunpowder, in rockets, fire-works, &c. The days of
some saints are remarkable for the right every man, bearing the
same name, assumes of lighting up a great bonfire in front of his
house; and I remember accompanying a friend in his chaise, on the
evening of St. John’s day, when we had some difficulty in getting the
horse through the flames and sky-rockets that illuminated and
occupied the whole street fronting the dwellings of all the Senhor
Joaos. The horses generally, however, do not regard it, being so
accustomed to fire and gunpowder. During my stay at Rio, a bell was
christened, and placed on the south side of the royal chapel with
much ceremony. The King was godfather and the widow Princess
godmother. The bell was named John the Sixth, in honour of his
Majesty, who sprinkled it with salt and water, and at the period that it
was hoisted to its ultimate position, the town resounded with fire-
works and sky-rockets.
Religious exhibitions and feasts succeed each other with very
little intermission; and the Brazilian calendars present an
innumerable list of them. At Whitsuntide, three or four days are
dedicated to the consecration of oxen, fowls, &c. and their
consumption. The churches retail these articles at high prices,
producing a considerable revenue. In some of the parishes, at this
time, the inhabitants, by turns, are at the expense of a public feast,
and it occasionally costs some individuals seven or eight hundred
pounds. A boy, the son of the person giving this entertainment, sits
upon a throne, attended by boys and girls of his own age; he is
called the emperor, and, with a sceptre in his hand, presides over the
feast. I saw two exhibitions of this sort on the 1st of June, one in the
Campo St. Anna, and the other at the Lappa, accompanied with fire-
works. They are extremely ludicrous. The festival of Corpus Christi,
on the 10th of June, is one of their grandest processional displays. It
is only upon these occasions that the ladies appear in public. Early in
the day cabriolets, drawn by mules, are seen driving in every
direction towards the Ruas Direita and d’Aquitanda, containing
females in their gala dresses, while the military of every description
are assembled in the streets to assist in the procession, which
consists principally of priests and friars, whose prodigious numbers
are calculated to swell out a cavalcade, together with numerous
inhabitants of different parishes, wearing cloaks peculiar to the
churches, which are various and showy. The whole form two lines,
preceded with banners, each person, including the priests, carrying a
preposterous-looking wax candle, about six feet high, one end of
which is placed, at every step, upon the ground. The royal horses,
sumptuously caparisoned, and decorated with ribands from their
noses to the end of their long tails, are led by grooms dressed in the
most tawdry style, the royal servants of every order following; then
the judges, and all classes of people employed by the government.
The fidalgos and ministers precede and follow the bishop, who
carries the Host, under a superb canopy, attended by Princes Don
Pedro and Don Miguel, the supporters of his train! The King usually
follows the bishop as a train-bearer, but on this occasion he did not.
The dresses of all were rich and costly; and the procession,
amounting to some thousand persons, proceeded along the Rua
Direita and returned, by the Rua d’Aquitanda, to the palace chapel;
after which there was a grand display of fire-works. All the balconies
were crowded with females, adorned with precious stones. The
fronts of the houses were hung with silks and crimson velvet, gilded
with ornaments; and the streets were strewed with green leaves. The
general effect of the whole was very imposing.
There is rather a celebrated annual procession, on the 10th of
October, in the Rua dos Ourives, having its foundation in some
religious observance peculiar to the church of that street. All the
houses are hung outside with tapestry and other stuffs, and
ornamented with looking-glasses, and a great portion of the furniture
which the house contains, not of the most elegant sort, and generally
not over abundant. A procession of padres, and numerous others
belonging to the parish, takes place during the evening, drawing
together an immense concourse of people, while the females, who
spend the last penny to procure a gay dress for these occasions,
appear at the balconies in a profusion of finery. The houses are
illuminated, not with any transparent or appropriate devices, but with
wax and common tallow candles; some placed in the front of looking-
glasses, in order to produce a double brilliancy at half price.
The funeral processions are rather singular; and the interment of
a child particularly would appear to be the season of rejoicing rather
than grief. On these occasions the musical performers are the most
choice and costly. The corpse is never kept more than one day from
the time of the demise, and the funeral rites are usually celebrated
after dark; every one that chooses enlisting into the procession by
the acceptance of a wax-light. At a funeral which I saw at the Carmo,
a large and handsome church adjoining the royal chapel, two lines of
persons were ranged along the body of the building, from the
entrance towards the altar, facing each other, every one holding a
wax-light, nearly six feet high, in the right hand, and projected rather
forward. Some of the individuals of this assembly might be friends of
the deceased, but the major part consisted of persons casually met
with in the streets, or such as were led by curiosity into the church.
The acceptance of a light is deemed an honour done to the friends of
the dead, and the agents of the padres are not very scrupulous in
forcing them, if possible, into the hands of every one they see; the
motive for doing this is ascertained on knowing that the remainder of
all candles which are used become the perquisite of those very
worthy brethren. At the head of the two lines, amounting to perhaps
from one hundred to one hundred and fifty persons, the corpse was
placed upon a table or elevated platform, with the head exposed to
view, while its last vestments displayed the ill-founded notion of
importance which its survivors attach to outward and meretricious
show. The ceremony of itself not being calculated to impress the
mind with awe, none of those feelings of respectful gravity were
visible, which so solemn an occasion ought to have produced. When
it was finished, the body was conducted, with no regular procession,
through some outer avenues of the church, to the catacombs,
situated in a passage opposite to the jesuitical library. On arriving at
an inner cemetery of the catacombs, the lights of those who followed
were extinguished and taken from them by the persons whose duty it
was to secure this perquisite; and every one retiring in consequence,
the body disappeared by some other avenue, and I could not
possibly discover how it was afterwards disposed of. Upon another
occasion of the funeral obsequies of a general officer, I attempted to
see their mode of executing this last office; but, from the quickness
with which they slid away, and the extinguishing of the lights, I was
again disappointed. A friend, however, gave me the following
description of the interment of a girl, at which he was present. After
the ceremony and the music had ceased, they proceeded from the
said church of Our Lady of Carmo to the catacombs, where he
arrived, with two or three others, at that point of the cemetery which
was to receive the remains. The padres had disappeared, and no
one was there but the father of the girl and a person who may be
styled the sexton. The outer coverings had been taken off, and the
girl appeared richly dressed in embroidered muslin, with silk
stockings, and new shoes on, as if equipped for an assembly. The
coffin had no bottom, but the body was supported upon a piece of
satin, securely nailed around the upper part of it, when the nails
being withdrawn from the sides, the father, who was not dressed in
the sable vestments of a mourner but in those of a bridegroom,
disgusted my friend by his wanton and unfeeling conduct, and at this
moment threw a piece of muslin to the sexton, urging him to
despatch by shouting out “depressa, depressa.” The muslin being
drawn over the face of the girl, a large quantity of quick lime was
placed upon it, and another portion spread from the head along the
breast to the body, with a quantity on each side, when the man, with
much ceremony, formed a cross upon it with his trowel. During the
operation, the father, devoid of every proper sense of decency, cried
out to him, “Vamos, vamos” (let us go); and, at another time,
“Vamos, depressa, filho da pouta.” To render this last exclamation
into English would only wound the feelings of those who do not
understand it. Quick lime being now placed upon the flat stone of the
cemetery, which runs horizontally a long way back, exhibiting its
awful contents, the coffin was lifted up, and the nails of the end being
also taken out, the body and piece of satin fell upon the quick lime,
and the coffin was removed away. The cemeteries are afterwards
walled up and plastered over in front. This father then, and even
before, at the close of the church ceremony, embraced many people
for joy, invited some to go home with him to a grand supper prepared
for the occasion, and felt convinced that his child was gone to
Heaven. Two or three hundred pounds are occasionally expended at
funerals.
The catacombs are small but extremely neat, the first part
forming a square, ornamented with vases, and containing aromatic
shrubs and flowers, is surrounded with a sort of piazza, the inner
walls of which present the front of cemeteries, neatly plastered and
numbered. Opposite the entrance, and crossing the square, a door-
way leads to inner avenues, lined with cemeteries, kept exceedingly
clean and in good order. At the extremity of one of these avenues is
situated the general charnel-house, where the bones are piled in
accumulating masses. After a certain lapse of time, the bones of
individuals are taken from the cemeteries, bound together, and a
large label, with their names inscribed upon it, affixed to them, then
piled upon the bones of their predecessors in the charnel house,
where two tapers are constantly burning; and it is not uncommon for
the relatives of the deceased to visit this house of the dead on a
certain day in the year, offering prayers in their behalf.
The bodies of the churches are open spaces, without seats or
pews, and the women sit down in the Turkish style; they, as well as
the men, occasionally fall upon their knees, and, during mass, go
through the ceremonies of crossing their foreheads, chins, and
breasts, at regular stated periods, frequently beating their bosoms
with great vehemence, but which probably must not be taken as a
positive demonstration of sincerity, however imposing it may
outwardly appear.
The relation of one more procession will enable the reader to
form some estimate of the religious character of this people. On the
event of illness having assumed the appearance of terminating in
death, the Host is conducted by one or more padres, and its usual
attendants, in much pomp, with a burning of incense and the tinkling
of bells, to the house of the dying person, to afford him the last
consolations of his religion.
The procession of the Host requires from the public more
obsequious reverence than all the other component ingredients of
the Catholic faith. Many persons prostrate themselves before it on
their knees, in the streets and balconies; others bend the body, and
all take off their hats. I have frequently met this procession some
miles in the country, the padre mounted on horseback, carrying with
the same facility as an umbrella, a canopy in his hand, and under its
sacred shade the Host, or emblem of the Holy Ghost, accompanied
by some attendants uncovered, and robed in scarlet cloaks, also on
horseback; the whole moving on at a quick ambling pace, with the
tinkling of bells, the peculiarity of which announces their approach,
producing an universal prostration of all persons, white and black,
who may be in the fields or houses adjoining the road. There is one
custom the Brazilians have, which, if sincere, cannot but be admired;
every evening at sun-set, by a simultaneous movement, they take off
their hats in the public streets, offer up a prayer, or repeat Avi
Marias; from which they have acquired the habit of denoting that
period of the evening by the term of Avi Maria. And they say so and
so before Avi Maria, at Avi Maria, or after Avi Maria.
I have been in the house of a Portuguese family at Avi Maria,
when they appear to repeat a short prayer, after which a general
salutation takes place, by saying “boa noite,” (good evening,) and
holding out their hands, as if they were mutually bestowing a
blessing. It is the custom for all slaves to hold their hands out in a
similar manner night and morning, as soon as they see their
superiors, for the purpose of offering a blessing, while their usual
expression is “Abençoa senhor.”
Rio de Janeiro, although the residence of the court, is centuries
behind in the comforts and enjoyments of civilized life. Strangers are
disgusted with a first ramble through this city, and would not
voluntarily pay it a second visit. Friendly attention to foreigners,
although they may have letters of introduction, the Brazilians are
seldom or ever known to practise. After some ceremony, they follow
the person introduced to the top of the stairs, wait there till he arrives
at the bottom, subject him to the further form of turning round to
receive their final salutation, and thus the matter briefly ends. How
different to the refinement of their neighbouring colonists, the
Spaniards, whose houses and tertulas, at Monte Video, at Buenos
Ayres, and all other parts of Spanish America, are open to strangers,
who experience every liberality and social attention from them. I was
assured by an English gentleman, who has resided ten years in the
Brazil, that he never witnessed any symptom of genuine hospitality,
and he had notwithstanding acted with friendship to many; and to
one gentleman, in particular, he had rendered frequent services, at
whose house he had called on various occasions, and sometimes
casually at the dinner hour, but was never invited to take dinner or
any kind of refreshment. Even the principal people have no idea of
the comforts of the table; when they give feasts, it is with an
extravagant profusion of dishes, without any regard to the
arrangement, and unattended with any of that elegant ease and
order practised by similar classes in most European countries.
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!

textbookfull.com

You might also like