Linux Cookbook: Essential Skills for Linux Users and System & Network Administrators 2nd Edition Carla Schroder 2024 Scribd Download
Linux Cookbook: Essential Skills for Linux Users and System & Network Administrators 2nd Edition Carla Schroder 2024 Scribd Download
com
https://ebookmeta.com/product/linux-cookbook-essential-
skills-for-linux-users-and-system-network-
administrators-2nd-edition-carla-schroder/
OR CLICK HERE
DOWLOAD NOW
https://ebookmeta.com/product/linux-containers-and-virtualization-
utilizing-rust-for-linux-containers-2nd-edition-shashank-mohan-jain/
ebookmeta.com
https://ebookmeta.com/product/linux-shell-scripting-cookbook-2nd-
edition-shantanu-tushar-sarath-lakshman/
ebookmeta.com
https://ebookmeta.com/product/awkward-politics-technologies-of-
popfeminist-activism-1st-edition-carrie-smith-prei/
ebookmeta.com
Stop and Spell the Roses Enchanted Flower Shop Cozy
Mystery 1 Anderson
https://ebookmeta.com/product/stop-and-spell-the-roses-enchanted-
flower-shop-cozy-mystery-1-anderson/
ebookmeta.com
https://ebookmeta.com/product/plant-based-comfort-food-classics-
simple-and-nourishing-vegan-dishes-sandra-vungi/
ebookmeta.com
https://ebookmeta.com/product/what-are-microservices-2nd-edition-sam-
newman/
ebookmeta.com
https://ebookmeta.com/product/wolf-gatherings-box-set-volume-two-
becca-jameson/
ebookmeta.com
https://ebookmeta.com/product/mouse-models-of-cancer-methods-and-
protocols-methods-in-molecular-biology-2773-1st-edition-maja-cemazar/
ebookmeta.com
The Amateur s Guide to Landscape Photography 2022 Edition
Claude Dibugnara
https://ebookmeta.com/product/the-amateur-s-guide-to-landscape-
photography-2022-edition-claude-dibugnara/
ebookmeta.com
Se dit
co ion
E
nd
Linux
Cookbook
Essential Skills for Linux Users and
System & Network Administrators
Carla Schroder
SECOND EDITION
Linux Cookbook
Essential Skills for Linux Users and
System and Network Administrators
Carla Schroder
Linux Cookbook
by Carla Schroder
Copyright © 2021 Carla Schroder. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are
also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional
sales department: 800-998-9938 or [email protected].
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Linux Cookbook, the cover image, and
related trade dress are trademarks of O’Reilly Media, Inc.
The views expressed in this work are those of the author, and do not represent the publisher’s views.
While the publisher and the author have used good faith efforts to ensure that the information and
instructions contained in this work are accurate, the publisher and the author disclaim all responsibility
for errors or omissions, including without limitation responsibility for damages resulting from the use of
or reliance on this work. Use of the information and instructions contained in this work is at your own
risk. If any code samples or other technology this work contains or describes is subject to open source
licenses or the intellectual property rights of others, it is your responsibility to ensure that your use
thereof complies with such licenses and/or rights.
978-1-492-08716-8
[LSI]
Table of Contents
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
1. Installing Linux. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Booting from Installation Media 2
Where to Download Linux 3
Best Linux for Newbies 3
1.1 Entering your System BIOS/UEFI Setup 4
1.2 Downloading a Linux Installation Image 6
1.3 Creating a Linux Installation USB Stick with UNetbootin 7
1.4 Creating a Linux Installation DVD with K3b 9
1.5 Using the wodim Command to Create a Bootable CD/DVD 12
1.6 Creating a Linux Installation USB Stick with the dd Command 13
1.7 Trying a Simple Ubuntu Installation 15
1.8 Customizing Partitioning 18
1.9 Preserving Existing Partitions 22
1.10 Customizing Package Selection 23
1.11 Multibooting Linux Distributions 29
1.12 Dual-boot with Microsoft Windows 31
1.13 Recovering an OEM Windows 8 or 10 Product Key 34
1.14 Mounting Your ISO Image on Linux 35
iii
2.7 Changing Font Colors in the GRUB Menu 49
2.8 Applying a Theme to Your GRUB Menu 52
2.9 Rescuing a Nonbooting System from the grub> Prompt 54
2.10 Rescuing a Nonbooting System from the grub rescue> Prompt 56
2.11 Reinstalling Your GRUB Configuration 58
iv | Table of Contents
5.9 Creating a System User with adduser on Ubuntu 114
5.10 Creating User and System Groups with addgroup 115
5.11 Checking Password File Integrity 116
5.12 Disabling a User Account 117
5.13 Deleting a User with userdel 118
5.14 Deleting a User with deluser on Ubuntu 119
5.15 Removing a Group with delgroup on Ubuntu 120
5.16 Finding and Managing All Files for a User 120
5.17 Using su to Be Root 122
5.18 Granting Limited Root Powers with sudo 123
5.19 Extending the sudo Password Timeout 126
5.20 Creating Individual sudoers Configurations 127
5.21 Managing the Root User’s Password 127
5.22 Changing sudo to Not Ask for the Root Password 128
Table of Contents | v
7.8 Excluding Files from Backup 170
7.9 Including Selected Files to Backup 172
7.10 Managing Includes with a Simple Include File 173
7.11 Managing Includes and Excludes with an Exclude File 174
7.12 Limiting rsync’s Bandwidth Use 176
7.13 Building an rsyncd Backup Server 177
7.14 Limiting Access to rsyncd Modules 180
7.15 Creating a Message of the Day for rsyncd 182
vi | Table of Contents
10.9 Listing Partitions and Hard Disks with lsblk 237
10.10 Getting CPU Information 238
10.11 Identifying Your Hardware Architecture 240
16. Managing Local Name Services with Dnsmasq and the hosts File. . . . . . . . . . . . . . . . . 367
16.1 Simple Name Resolution with /etc/hosts 368
16.2 Using /etc/hosts for Testing and Blocking Annoyances 371
16.3 Finding All DNS and DHCP Servers on Your Network 372
16.4 Installing Dnsmasq 374
16.5 Making systemd-resolved and NetworkManager Play Nice with
Dnsmasq 375
16.6 Configuring Dnsmasq for LAN DNS 376
16.7 Configuring firewalld to Allow DNS and DHCP 379
16.8 Testing Your Dnsmasq Server from a Client Machine 380
16.9 Managing DHCP with Dnsmasq 381
16.10 Advertising Important Services over DHCP 383
16.11 Creating DHCP Zones for Subnets 384
16.12 Assigning Static IP Addresses from DHCP 385
16.13 Configuring DHCP Clients for Automatic DNS Entries 386
16.14 Managing Dnsmasq Logging 388
16.15 Configuring Wildcard Domains 389
Table of Contents | ix
18.8 Adding a Second Ethernet Interface 420
18.9 Setting Up an Internet Connection Sharing Firewall with firewalld 424
18.10 Running Your Raspberry Pi Headless 427
18.11 Building a DNS/DHCP Server with Raspberry Pi 428
x | Table of Contents
Appendix. Software Management Cheatsheets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
Table of Contents | xi
Preface
Way back in olden times I wrote the first edition of the Linux Cookbook, which was
released unto a joyous world in 2004. It sold well, I heard from many happy readers,
and some are still my friends.
For a Linux book, 17 years old is ancient. Linux was 14 years old in 2004, a wee baby
computer operating system. Even so, it was already a popular and widely used power‐
house, adapting to any role, from tiny embedded devices to mainframes and super‐
computers. The rapid growth of Linux is partly due to it being a free clone of Unix,
the most mature and powerful operating system of all. The other major factor in the
speedy growth and adoption of Linux is the absence of barriers. Anyone can down‐
load and try it, and the source code is freely available to anyone who wants to use and
contribute to it.
At the time it was a great example of form following function, like my first car. It ran,
it was reliable, but it wasn’t pretty, and it needed a lot of custom wiggling of this and
jiggling of that to keep going. Running a Linux system back then meant learning your
way around a hodgepodge of commands, scripts, and configuration files, and a fair
bit of wiggling and jiggling. Software management, storage management, networking,
audio, video, kernel management, process management…everything required a lot of
hands-on work and continual study.
Some 17 years later, every important subsystem in Linux has substantially changed
and improved. Now all those manual chores we had to do for basic administration
are replaced by what I call “It Just Works Subsystems.” Every aspect of running a
Linux system is many times easier, and we can focus on using Linux to do cool things
instead of having to wiggle and jiggle this and that just to keep it running.
I am delighted to present this greatly updated Linux Cookbook second edition, and I
hope you enjoy learning about all of this cool new goodness.
xiii
Other documents randomly have
different content
culotte, incline approbativement la tête :
— Paule a raison ; ainsi, habillée, comme je le suis en ce moment,
impossible d’entendre des vers.
— Mais c’est certain, confirme Paule.
— Alors, votre entendement dépend de vos costumes, demande
Didier.
— Très assurément, dit Roseline ; il n’y a que les brutes qui soient
insensibles à ces choses ; aujourd’hui, quand je veux avoir une petite
explication sérieuse avec Armand, j’endosse ma tenue de bicycliste ;
j’ai une décision là dedans !… il sait que c’est inutile de me tenir
tête ; vous avez bien tort, Paule, de ne pas vous décider à adopter la
bicyclette ; cela procure des idées claires et nettes ; on sait joliment
bien ce qu’on veut quand on a pédalé jusqu’à Saint-Germain.
— Ah ! madame, laissez-la en paix, gémit Mousse, laissez-la
penser à son portrait.
— Oui, dit Didier, faisons d’abord son portrait, parlons-lui de
Tristan.
— Du reste, continue Paule, rien ne me fera jamais aller à
bicyclette. Mon mari en a la rage : il voudrait venir avec moi ; ce
serait insoutenable.
— Qu’est-ce que cela vous ferait ? dit Roseline ; ne vous en
occupez pas !
— Mais il s’occupe de moi… c’est une manie… Et dire qu’il y a des
femmes qui ont le bonheur de se démarier !…
— Ah ! voyons, dit Didier, vous n’allez pas vouloir divorcer ! c’est
du dernier vulgaire.
— Non, mon ami, pas divorcer… mais voir mon mariage annulé,
c’est mon rêve ; j’y réfléchis tout le temps que Charlotte récite ;
pensez donc ! ne plus avoir de mari ! se dire par le fait qu’on n’en a
jamais eu ; je trouve cela une situation ravissante !
— Peut-être, dit Roseline ; mais quel prétexte pourriez-vous
prendre ?
— C’est là l’obstacle, soupire Paule, s’affaissant délicieusement
dans sa belle robe blanche et laissant traîner ses doigts sur la
fourrure caressante ; il paraît que la répugnance ne suffit pas ; c’est
barbare, ça !
— Il est bien certain, dit Didier, que les lois actuelles du mariage
répondent à un état de société absolument éloigné de la véritable
civilisation ! Les abeilles sont plus intelligentes : elles ont au moins
leurs reines affranchies de toutes les servitudes. Notre belle amie est
une reine parmi les abeilles ; son seul devoir est d’être belle, n’est-ce
pas Mousse ?
Mousse, qui, l’œil noyé, s’est rencogné dans son coin et depuis
un moment brise sans merci les feuilles d’émail d’un gardénia délicat
dont la senteur subtile flotte dans l’air, répond de la voix d’un
homme qu’on va mener pendre :
— C’est mon avis.
— Mon cher Mousse, dit madame de Vaubonne, vous aussi, vous
devriez faire de la bicyclette. Vous avez l’air trop sombre ; nous ne
pourrons pas vous permettre de continuer le portrait de madame
d’Haspre ; la tristesse est nuisible à la beauté.
— Non, chère, n’ayez pas peur ; le désespoir amoureux ne
m’afflige pas, j’en ai l’habitude. Mon mari l’est bien, amoureux de
moi… c’est pour cela qu’il m’ennuie tant. Ah ! Didier, vous ne
pourriez pas creuser mon cas théologiquement…
— Je chercherai, madame, je chercherai ; j’entrevois des
possibilités !…
— Mon ami, vous me rendez la vie ; ne plus être obligée de
rentrer en voiture le soir avec quelqu’un qui m’agace !… Imaginez-
vous que nous n’avons pas un avis en commun ; toutes ses
admirations m’horripilent ; heureusement qu’à l’Opéra je l’ai dans
mon dos ; du reste, il trouve toutes mes appréciations
inconvenantes… c’est charmant ; il dit que mes béatitudes l’agacent ;
c’est au sujet de Tristan et d’Yseult qu’il a tenu ce joli propos.
— Mais, madame, intervient humblement Mousse, si vous aimez
Tristan, vous ne détestez pas tant l’amour ?
— D’abord, mon ami, c’est l’amour coupable ; ensuite, Tristan
meurt, n’est-ce pas ? Je veux bien qu’on meure pour moi.
— Mais à quoi cela vous servirait-il, madame ?
— Mais peut-être à me faire vivre ; en principe, je n’y ai pas
d’objections, et vous, Roseline ?
— Non, ma chère, c’est inutile, il faut se maintenir dans les
réalités. Quand votre portrait sera fini, je vous conseille de vous
reposer un peu de Tristan et d’Yseult.
— Nous ferons de la théologie ensemble, madame, dit Didier.
— Ah ! oui, ce doit être bien intéressant, je suis convaincue qu’il
doit y avoir un moyen de trouver un cas de nullité ; quand on pense
que mon mari se mêle de demander à quelles heures j’irai poser
chez Mousse ! Je vous avertis, n’est-ce pas, Mousse, que je défends
qu’on le laisse entrer jamais : il verra mon portrait quand il sera
terminé ; j’entends me faire peindre à ma manière, pas à la sienne ;
je considère mes épaules comme ma propriété particulière, je le lui
ai signifié ! Voyez-vous, ce sont les airs de propriétaire qui me
mettent hors de moi. Qu’est-ce que c’est, en somme, pour moi, que
M. d’Haspre ? Un monsieur quelconque avec qui le hasard m’a mise
en rapport ; on ne me fera jamais croire que des phrases prononcées
par un autre monsieur quelconque peuvent lui donner le droit de me
défendre de penser à ma guise, et me forcer de ne trouver que lui
de beau au monde ! Mais c’est un conte de Croquemitaine ces
histoires-là, et il est en furie quand je le lui dis ; mais je ne le
regarde pas du tout comme ma propriété, moi !
— Vous avez raison, madame, mille fois raison ; nous vous
affranchirons, et vous serez belle comme vous l’entendrez, et pour
qui il vous plaira.
— Je ne demande pas autre chose. Je ne veux pas de mal à M.
d’Haspre, seulement, qu’il ne s’occupe pas de moi.
— Le fait est, acquiesce madame de Vaubonne, que le mariage
n’est admissible que de cette façon ; mais il faudra réfléchir, croyez-
moi, Paule ; vous pourriez trouver cela gênant de ne plus avoir de
mari : ils ont leur utilité.
— Je n’en vois aucune !… Tenez, si je ne change pas de robe pour
déjeuner, il ne dira rien, mais il fera une tête !… Qu’est-ce qu’elle a
d’étonnant, je vous le demande, ma robe ? Si je montre mon cou à
un valet de pied, le matin, il me fait des scènes, et, le soir, c’est tout
simple… ils sont fous, tout bonnement, ils pensent toujours à mal.
Et là-dessus, Jacques Mousse, plus ténébreux qu’à l’arrivée, se
lève le premier pour prendre congé.
— Dites, madame, quand commençons-nous ?
— Mais, demain, mon ami, si vous voulez.
— Seulement, il faudra amener Charlotte, ajoute Didier.
— Ah ! oui, reprend gravement Paule, à toute force ; à moins que
vous ne lisiez l’allemand, Didier ?
— Non, madame, mais nous pourrons mettre Charlotte derrière
un paravent, et je m’offre pour vous brosser les cheveux : je m’en
acquitterai à merveille.
Et il prend entre ses mains une mèche dorée qu’il porte à ses
lèvres.
— Je veux bien, moi, répond la belle Paule.
Et, repoussant de la main la chevelure légère qui lui frisonne
autour du visage :
— Et tenez, si mon mari était là, il crierait au scandale !
. . . . . . . . . . . . . . . . . . . .
X
LE PÉCHÉ