Using and Administering Linux: Volume 2 - David Both

Using and Administering Linux: Volume 2 (eBook)

Zero to SysAdmin: Advanced Topics

(Autor)

eBook Download: PDF
2019 | 1st ed.
XXXV, 583 Seiten
Apress (Verlag)
978-1-4842-5455-4 (ISBN)
Systemvoraussetzungen
79,99 inkl. MwSt
  • Download sofort lieferbar
  • Zahlungsarten anzeigen

Experience an in-depth exploration of logical volume management and the use of file managers to manipulate files and directories and the critical concept that, in Linux, everything is a file and some fun and interesting uses of the fact that everything is a file.

This book builds upon the skills you learned in Volume 1 of this course and it depends upon the virtual network and virtual machine created there. More experienced Linux users can begin with this volume and download the assigned script that will set up the VM for the start of Volume 2. Instructions with the script will provide specifications for configuration of the virtual network and the virtual machine. Refer to the volume overviews in the book's introduction to select the volume of this course most appropriate for your current skill level.

You'll see how to manage and monitor running processes, discover the power of the special filesystems, monitor and tune the kernel while it is running - without a reboot. You'll then turn to regular expressions and the power that using them for pattern matching can bring to the command line, and learn to manage printers and printing from the command line and unlock the secrets of the hardware on which your Linux operating system is running.

Experiment with command line programming and how to automate various administrative tasks, networking, and the many services that are required in a Linux system. Use the logs and journals to look for clues to problems and confirmation that things are working correctly, and learn to enhance the security of your Linux systems and how to perform easy local and remote backups.

What You Will Learn

  • Understand Logical Volume Management, using file managers, and special filesystems
  • Exploit everything in a file
  • Perform command line programming and basic automation
  • Configure printers and manage other hardware
  • Manage system services with systemd, user management, security, and local and remote backups using simple and freely available tools

Who This Book Is For

Anyone who wants to continue to learn Linux in depth as an advanced user and system administrator at the command line while using the GUI desktop to leverage productivity. 




David Both is a Linux and Open Source advocate who resides in Raleigh, North Carolina. He has been in the IT industry for over forty years and taught OS/2 for IBM where he worked for over 20 years. While at IBM, he wrote the first training course for the original IBM PC in 1981. He has taught RHCE classes for Red Hat and has worked at MCI Worldcom, Cisco, and the State of North Carolina. He has been working with Linux and Open Source Software for 20 years. David has written articles for OS/2 Magazine, Linux Magazine, Linux Journal and OpenSource.com. 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 has spoken at POSSCON and All Things Open (ATO).
Experience an in-depth exploration of logical volume management and the use of file managers to manipulate files and directories and the critical concept that, in Linux, everything is a file and some fun and interesting uses of the fact that everything is a file.This book builds upon the skills you learned in Volume 1 of this course and it depends upon the virtual network and virtual machine created there. More experienced Linux users can begin with this volume and download the assigned script that will set up the VM for the start of Volume 2. Instructions with the script will provide specifications for configuration of the virtual network and the virtual machine. Refer to the volume overviews in the book's introduction to select the volume of this course most appropriate for your current skill level.You ll see how to manage and monitor running processes, discover the power of the special filesystems, monitor and tune the kernel while it is running without a reboot. You ll then turn to regular expressions and the power that using them for pattern matching can bring to the command line, and learn to manage printers and printing from the command line and unlock the secrets of the hardware on which your Linux operating system is running. Experiment with command line programming and how to automate various administrative tasks, networking, and the many services that are required in a Linux system. Use the logs and journals to look for clues to problems and confirmation that things are working correctly, and learn to enhance the security of your Linux systems and how to perform easy local and remote backups.What You Will LearnUnderstand Logical Volume Management, using file managers, and special filesystemsExploit everything in a filePerform command line programming and basic automationConfigure printers and manage other hardwareManage system services with systemd, user management, security, and local and remote backups using simple and freely available toolsWho This Book Is ForAnyone who wants to continue to learn Linux in depth as an advanced user and system administrator at the command line while using the GUI desktop to leverage productivity. 

Table of Contents 5
About the Author 18
About the Technical Reviewer 19
Acknowledgments 20
Introduction 21
Chapter 1: Logical Volume Management 32
Objectives 32
The need for logical volume management 32
Running out of disk space in VirtualBox 33
Recovery 33
LVM structure 34
Extending a logical volume 35
Extending volume groups 38
Create a new volume group – 1 38
Create a new volume group – 2 42
Tips 44
Advanced capabilities 45
Chapter summary 45
Exercises 46
Chapter 2: File Managers 47
Objectives 47
Introduction 47
Text-mode interface 48
Graphical interface 48
Default file manager 48
Text-mode file managers 50
Midnight Commander 50
Other text-mode file managers 61
Vifm 61
nnn 62
Graphical file managers 63
Krusader 64
Thunar 67
Dolphin 68
XFE 70
Chapter summary 71
Exercises 71
Chapter 3: Everything Is a File 72
Objectives 72
What is a file? 72
Device files 73
Device file creation 74
udev simplification 74
Naming rules 75
Device data flow 76
Device file classification 77
Fun with device files 79
Randomness, zero, and more 84
Back up the master boot record 87
Implications of everything is a file 94
Chapter summary 94
Exercises 95
Chapter 4: Managing Processes 96
Objectives 96
Processes 96
Process scheduling in the kernel 96
Tools 97
top 98
Summary section 100
Process section 101
More about load averages… 104
…and signals 105
CPU hogs 106
Process scheduling 108
Nice numbers 108
Killing processes 111
Other interactive tools 112
atop 112
Summary section 113
Process section 114
Configuration 115
htop 115
Summary section 116
Process section 117
Configuration 120
Glances 122
Summary section 122
Process section 123
Sidebar 124
Configuration 124
Other tools 125
The impact of measurement 131
Chapter summary 131
Exercises 132
Chapter 5: Special Filesystems 133
Objectives 133
Introduction 133
The /proc filesystem 134
The /sys filesystem 144
Swap space 149
Types of Linux swap 150
Thrashing 151
What is the right amount of swap space? 151
Adding more swap space on a non-LVM disk partition 154
Adding swap to an LVM disk environment 159
Other swap options with LVM 163
Chapter summary 163
Exercises 164
Chapter 6: Regular Expressions 165
Objectives 165
Introducing regular expressions 165
Getting started 167
The mailing list 167
The first solution 169
The second solution 174
grep 175
Data flow 175
regex building blocks 176
Repetition 179
Other metacharacters 180
sed 182
Other tools that implement regular expressions 184
Resources 184
Chapter summary 185
Exercises 185
Chapter 7: Printing 186
Objectives 186
Introduction 187
About printers 187
Print languages 188
Printers and Linux 188
CUPS 191
Creating the print queue 193
Printing to a PDF file 198
File conversion tools 201
a2ps 202
ps2pdf 204
pr 204
ps2ascii 205
Operating system–related conversion tools 207
unix2dos 208
dos2unix 210
unix2mac and mac2unix 210
Miscellaneous tools 211
lpmove 211
wvText and odt2txt 214
Chapter summary 216
Exercises 216
Chapter 8: Hardware Detection 218
Objectives 218
Introduction 218
dmidecode 220
lshw 228
lsusb 232
usb-devices 234
lspci 236
Cleanup 239
Chapter summary 240
Exercises 240
Chapter 9: Command-Line Programming 241
Objectives 241
Introduction 241
Definition of a program 242
Simple CLI programs 243
Some basic syntax 243
Output to the display 245
Something about variables 247
Control operators 249
Return codes 250
The operators 251
Program flow control 253
true and false 254
Logical operators 255
Syntax 255
File operators 256
String comparison operators 261
Numeric comparison operators 264
Miscellaneous operators 266
Grouping program statements 267
Expansions 270
Brace expansion 271
Tilde expansion 271
Pathname expansion 271
Command substitution 273
Arithmetic expansion 274
for loops 276
Other loops 281
while 281
until 283
Chapter summary 284
Exercises 285
Chapter 10: Automation with Bash Scripts 286
Objectives 286
Introduction 287
Why I use shell scripts 287
Shell scripts 288
Scripts vs. compiled programs 289
Updates 290
About updates 290
Create a list of requirements 290
The CLI program 292
Convert the CLI program to a script 292
Add some logic 294
Limit to root 296
Add command-line options 297
Check for updates 299
Is a reboot required? 301
Adding a Help function 304
Finishing the script 307
About testing 308
Testing in production 309
Fuzzy testing 310
Testing the script 310
Making it better 313
Licensing 314
Automated testing 317
Security 317
Additional levels of automation 318
Chapter summary 320
Exercises 321
Chapter 11: Time and Automation 322
Objectives 322
Introduction 322
Keeping time with chrony 323
The NTP server hierarchy 323
NTP choices 324
Chrony structure 325
Client configuration 325
chronyc as an interactive tool 329
Using cron for timely automation 330
The crond daemon 331
crontab 331
cron examples 333
crontab entries 334
Other scheduling options 337
/etc/cron.d 337
anacron 338
Thoughts about cron 340
Scheduling tips 340
Security 341
cron resources 341
at 342
Syntax 342
Time specifications 342
Security 348
Cleanup 348
Chapter summary 348
Exercises 349
Chapter 12: Networking 350
Objectives 350
Introduction 350
About IPv6 351
Basic networking concepts 351
Definitions 351
MAC address 353
IP address 356
IP address assignments 359
TCP/IP 359
The TCP/IP network model 359
A simple example 361
CIDR – Network notation and configuration 363
Network classes 363
Along came a CIDR 366
Variable Length Subnet Masking 369
DHCP client configuration 373
NIC naming conventions 374
How it works – sort of 374
NIC configuration files 376
Create an interface configuration file 377
The interface configuration file 379
The network file 384
The route-< interface>
Other network files 385
Network startup 385
The NetworkManager service 385
Name services 386
How a name search works 387
Using the /etc/hosts file 388
Introduction to network routing 392
The routing table 392
iptraf-ng 398
Cleanup 402
Chapter summary 402
Exercises 403
Chapter 13: systemd 404
Objectives 404
Introduction 404
Controversy 405
Why I prefer SystemV 405
Why I prefer systemd 406
The real issue 407
systemd suite 407
Practical structure 408
systemctl 409
Service units 413
Mount units 416
systemd timers 420
Time specification 421
Timer configuration 424
systemd-analyze 428
Journals 429
Chapter summary 432
References 433
Exercises 435
Chapter 14: D-Bus and udev 436
Objectives 436
/dev chaos 436
About D-Bus 437
About udev 437
Naming rules 440
Making udev work 441
Using Udev for your success 441
A basic script 441
Unique device identification 442
Refining the rule into something useful 445
Security 446
Udev in the real world 447
Udev is your Dev 448
Chapter summary 448
Exercises 449
Chapter 15: Logs and Journals 450
Objectives 450
Logs are your friend 450
SAR 451
logrotate 454
messages 458
Mail logs 460
dmesg 461
secure 463
Following log files 465
systemd journals 467
logwatch 471
Chapter summary 481
Exercises 481
Chapter 16: Managing Users 483
Objectives 483
Introduction 483
The root account 484
Your account 484
Your home directory 485
User accounts and groups 485
The /etc/passwd file 487
nologin shells 491
The /etc/shadow file 491
The /etc/group file 496
The /etc/login.defs file 496
Account configuration files 496
Password security 497
Password encryption 498
Generating good passwords 500
Password quality 502
Managing user accounts 504
Creating new accounts 504
The useradd command 504
Creating new accounts by editing the files 507
Locking the password 510
Deleting user accounts 511
Forcing account logoff 512
Setting resource limits 513
Chapter summary 517
Exercises 517
Chapter 17: Security 519
Objectives 519
Introduction 519
Security by obscurity 521
What is security? 521
Data protection 522
Security vectors 522
Self-inflicted problems 523
Environmental problems 523
Physical attacks 524
Network attacks 525
Software vulnerabilities 526
Linux and security 526
Login security 527
Checking logins 528
Telnet 532
SSH 540
The SSH server 540
Firewalls 544
firewalld 545
Understanding the rules 548
Deleting and adding rules 548
iptables 551
Converting to IPTables 551
Understanding the rule set 553
Managing rules with IPTables 556
Fail2Ban 559
PAM 562
Some basic steps 563
Chapter summary 566
Exercises 566
Chapter 18: Backup Everything – Frequently 568
Introduction 568
Backups to the rescue 568
The problem 569
Backup options 575
tar 575
Off-site backups 580
Disaster recovery services 581
Options 582
What about the “frequently” part? 582
How frequent is “frequently?” 583
What does “full” really mean? 583
All vs. diff 584
Considerations for automation of backups 584
Dealing with offline hosts 585
Advanced backups 585
Chapter summary 586
Exercises 586
Bibliography 588
Books 588
Web sites 589
Index 593

Erscheint lt. Verlag 11.12.2019
Zusatzinfo XXXV, 583 p. 110 illus.
Sprache englisch
Themenwelt Mathematik / Informatik Informatik
Schlagworte FOSS • Linux • linux foundation • Red Hat • sysadmin • system administration
ISBN-10 1-4842-5455-4 / 1484254554
ISBN-13 978-1-4842-5455-4 / 9781484254554
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)
Größe: 11,8 MB

DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasser­zeichen und ist damit für Sie persona­lisiert. Bei einer missbräuch­lichen Weiter­gabe des eBooks an Dritte ist eine Rück­ver­folgung an die Quelle möglich.

Dateiformat: PDF (Portable Document Format)
Mit einem festen Seiten­layout eignet sich die PDF besonders für Fach­bücher mit Spalten, Tabellen und Abbild­ungen. Eine PDF kann auf fast allen Geräten ange­zeigt werden, ist aber für kleine Displays (Smart­phone, eReader) nur einge­schränkt geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.

Zusätzliches Feature: Online Lesen
Dieses eBook können Sie zusätzlich zum Download auch online im Webbrowser lesen.

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich
Konzepte, Methoden, Lösungen und Arbeitshilfen für die Praxis

von Ernst Tiemeyer

eBook Download (2023)
Carl Hanser Verlag GmbH & Co. KG
69,99
Konzepte, Methoden, Lösungen und Arbeitshilfen für die Praxis

von Ernst Tiemeyer

eBook Download (2023)
Carl Hanser Verlag GmbH & Co. KG
69,99
Der Weg zur professionellen Vektorgrafik

von Uwe Schöler

eBook Download (2024)
Carl Hanser Verlag GmbH & Co. KG
29,99