Preface xliii
Chapter 1: Welcome to Linux 1
The History of UNIX and GNU–Linux 2
Overview of Linux 11
Choosing an Operating System 19
Chapter Summary 21
Exercises 21
Part I: Installing Ubuntu Linux 23
Chapter 2: Installation Overview 25
Conventions Used in This Book 26
More Information 29
Planning the Installation 30
Ubuntu Releases, Editions, and Derivatives 35
Setting Up the Hard Disk 38
Downloading an Image File and Burning/Writing the Installation Medium 47
Chapter Summary 53
Exercises 54
Advanced Exercises 54
Chapter 3: Step-by-Step Installation 55
Booting Ubuntu and Running a Live Session 56
Basic Installation 59
Advanced Installation 71
Chapter Summary 93
Exercises 94
Advanced Exercises 94
Part II: Using Ubuntu Linux 95
Chapter 4: Introduction to Ubuntu 97
Curbing Your Power: root Privileges/sudo 98
Logging In on the System 99
Working with the Unity Desktop 104
Using the Nautilus File Manager 108
The System Settings Window 113
Getting Help 118
Installing, Removing, and Updating Software Packages 121
Working from the Command Line 125
More About Logging In and Passwords 142
Chapter Summary 145
Exercises 146
Advanced Exercises 147
Chapter 5: The Shell 149
Special Characters 150
Ordinary Files and Directory Files 151
The Command Line 152
Standard Input and Standard Output 159
Running a Command in the Background 171
Filename Generation/Pathname Expansion 173
Builtins 178
Chapter Summary 178
Exercises 179
Advanced Exercises 181
Chapter 6: The Linux Filesystem 183
The Hierarchical Filesystem 184
Ordinary Files and Directory Files 185
Pathnames 189
Working with Directories 191
Access Permissions 199
ACLs: Access Control Lists 206
Links 211
Chapter Summary 217
Exercises 219
Advanced Exercises 220
Chapter 7: The Linux Utilities 223
Basic Utilities 224
Working with Files 232
Compressing and Archiving Files 253
Displaying User and System Information 260
Miscellaneous Utilities 263
Editing Files 270
Chapter Summary 280
Exercises 282
Advanced Exercises 283
Chapter 8: Networking and the Internet 285
Introduction to Networking 286
Types of Networks and How They Work 288
Communicate over a Network 307
Network Utilities 308
Distributed Computing 315
WWW: World Wide Web 325
Chapter Summary 327
Exercises 328
Advanced Exercises 328
Part III: System Administration 331
Chapter 9: The Bourne Again Shell (bash) 333
Background 334
Startup Files 335
Commands That Are Symbols 339
Redirecting Standard Error 339
Writing and Executing a Shell Script 342
Control Operators: Separate and Group Commands 347
Job Control 352
Manipulating the Directory Stack 355
Parameters and Variables 358
Special Characters 372
Locale 374
Time 377
Processes 379
History 382
Aliases 398
Functions 402
Controlling bash: Features and Options 404
Processing the Command Line 409
Chapter Summary 420
Exercises 421
Advanced Exercises 423
Chapter 10: System Administration: Core Concepts 425
The Upstart Event-Based init Daemon 427
System Operation 437
GRUB: The Linux Boot Loader 444
Recovery (Single-User) Mode 450
Textual System Administration Utilities 454
Setting Up a Server 460
DHCP: Configures Network Interfaces 464
nsswitch.conf: Which Service to Look at First 468
X Window System 471
Getting Help 476
Chapter Summary 477
Exercises 478
Advanced Exercises 478
Chapter 11: Files, Directories, and Filesystems 479
Important Files and Directories 480
File Types 493
Filesystems 497
The XFS Filesystem 506
Chapter Summary 507
Exercises 508
Advanced Exercises 508
Chapter 12: Finding, Downloading, and Installing Software 509
Introduction 510
JumpStart: Installing and Removing Software Packages Using apt-get 512
Finding the Package That Holds an Application or File You Need 514
APT: Keeps the System Up to Date 515
dpkg: The Debian Package Management System 524
BitTorrent 531
Installing Non-dpkg Software 533
Keeping Software Up to Date 535
curl: Downloads Files Noninteractively 536
Chapter Summary 536
Exercises 537
Advanced Exercises 537
Chapter 13: Printing with CUPS 539
Introduction 540
The System Configures a Local Printer Automatically 542
JumpStart I: Configuring a Printer Using system-config-printer 542
JumpStart II: Setting Up a Local or Remote Printer 544
Working with the CUPS Web Interface 548
Configuring Printers 549
Traditional UNIX Printing 557
Printing from Windows 558
Printing to Windows 560
Chapter Summary 560
Exercises 561
Advanced Exercises 561
Chapter 14: Administration Tasks 563
Configuring User and Group Accounts 564
Backing Up Files 568
Scheduling Tasks 573
System Reports 576
Maintaining the System 578
Chapter Summary 593
Exercises 594
Advanced Exercises 594
Chapter 15: System Security 595
Running Commands with root Privileges 596
Passwords 615
Securing a Server 616
PAM 621
Cryptography 626
GPG (GNU Privacy Guard) 641
Security Resources 656
Chapter Summary 659
Exercises 660
Advanced Exercises 660
Chapter 16: Configuring and Monitoring a LAN 661
More Information 662
Setting Up the Hardware 662
Configuring the Systems 666
NetworkManager: Configures Network Connections 667
Setting Up Servers 672
Introduction to Cacti 674
Chapter Summary 683
Exercises 684
Advanced Exercises 685
Chapter 17: Setting Up Virtual Machines Locally and in the Cloud 687
VMs (Virtual Machines) 688
gnome-boxes 690
QEMU/KVM 691
VMware Player: Installing Ubuntu on VMware 698
Cloud Computing 703
Chapter Summary 708
Exercises 709
Advanced Exercises 709
Part IV: Using Clients and Setting Up Servers 711
Chapter 18: The OpenSSH Secure CommunicationUtilities 713
Introduction to OpenSSH 714
Running the ssh, scp, and sftp OpenSSH Clients 716
Setting Up an OpenSSH Server (sshd) 727
Troubleshooting 735
Tunneling/Port Forwarding 735
Chapter Summary 738
Exercises 739
Advanced Exercises 739
Chapter 19: The rsync Secure Copy Utility 741
Syntax 742
Arguments 742
Options 742
Examples 745
Chapter Summary 752
Exercises 752
Chapter 20: FTP: Transferring Files Across a Network 753
Introduction to FTP 754
Running the ftp and sftp FTP Clients 756
Setting Up an FTP Server (vsftpd) 764
Chapter Summary 777
Exercises 778
Advanced Exercises 778
Chapter 21: postfix: Setting Up Mail Servers, Clients, and More 779
Overview 780
Introduction to postfix 781
Setting Up a postfix Mail Server 784
JumpStart: Configuring postfix to Use Gmail as a Smarthost 787
Configuring postfix 789
SpamAssassin 797
Additional Email Tools 801
dovecot: Setting Up an IMAP or POP3 Mail Server 807
Chapter Summary 810
Exercises 811
Advanced Exercises 812
Chapter 22: NIS and LDAP 813
Introduction to NIS 814
Running an NIS Client 817
Setting Up an NIS Server 822
Introduction to LDAP 830
Setting Up an LDAP Server 833
Chapter Summary 839
Exercises 840
Advanced Exercises 840
Chapter 23: NFS: Sharing Directory Hierarchies 843
Introduction to NFS 845
Running an NFS Client 847
Setting Up an NFS Server 853
automount: Mounts Directory Hierarchies on Demand 863
Chapter Summary 866
Exercises 867
Advanced Exercises 867
Chapter 24: Samba: Linux and Windows File and Printer Sharing 869
Introduction to Samba 870
Running Samba Clients 874
Setting Up a Samba Server 878
Troubleshooting 887
Chapter Summary 889
Exercises 890
Advanced Exercises 890
Chapter 25: DNS/BIND: Tracking Domain Names and Addresses 891
Introduction to DNS 892
Setting Up a DNS Server 904
Configuring a DNS Server 907
Chapter Summary 920
Exercises 921
Advanced Exercises 921
Chapter 26: ufw, gufw, and iptables: Setting Up a Firewall 923
ufw: The Uncomplicated Firewall 924
gufw: The Graphical Interface to ufw 927
Introduction to iptables 932
Building a Set of Rules Using iptables 937
Copying Rules to and from the Kernel 944
Sharing an Internet Connection Using NAT 945
Chapter Summary 948
Exercises 949
Advanced Exercises 949
Chapter 27: Apache (apache2): Setting Up a Web Server 951
Introduction 952
Running an Apache Web Server 954
Configuration Directives 961
Advanced Configuration 984
Troubleshooting 990
Modules 991
webalizer: Analyzes Web Traffic 997
Error Codes 997
Chapter Summary 998
Exercises 998
Advanced Exercises 999
Part V: Programming Tools 1001
Chapter 28: Programming the Bourne Again Shell (bash) 1003
Control Structures 1004
File Descriptors 1038
Parameters 1044
Variables 1053
Builtin Commands 1062
Expressions 1078
Implicit Command-Line Continuation 1085
Shell Programs 1086
Chapter Summary 1096
Exercises 1098
Advanced Exercises 1100
Chapter 29: The Python Programming Language 1103
Introduction 1104
Scalar Variables, Lists, and Dictionaries 1108
Control Structures 1114
Reading from and Writing to Files 1119
Regular Expressions 1123
Defining a Function 1124
Using Libraries 1125
Lambda Functions 1129
List Comprehensions 1130
Chapter Summary 1131
Exercises 1132
Advanced Exercises 1132
Chapter 30: The MariaDB SQL Database Management System 1135
History 1136
Notes 1136
Installing a MariaDB Server 1140
Setting Up MariaDB 1141
Examples 1145
Chapter Summary 1157
Exercises 1157
Advanced Exercises 1157
Part VI: Appendixes 1159
Appendix A: Regular Expressions 1161
Characters 1162
Delimiters 1162
Simple Strings 1162
Special Characters 1162
Rules 1165
Bracketing Expressions 1166
The Replacement String 1166
Extended Regular Expressions 1167
Appendix Summary 1169
Appendix B: Help 1171
Solving a Problem 1172
Finding Linux-Related Information 1173
Specifying a Terminal 1175
Appendix C: Keeping the System Up to Date Using yum 1177
Installing and Removing Software Packages Using yum 1178
Working with yum 1179
Appendix D: LPI and Comptia Certification 1183
More Information 1184
Linux Essentials 1184
Certification Exam 1 Objectives: LX0-101 1198
Certification Exam 2 Objectives: LX0-102 1214
Glossary 1231
JumpStart Index 1285
File Tree Index 1287
Utility Index 1291
Main Index 1297
Mark G. Sobell is President of Sobell Associates Inc., a consulting firm that specializes in UNIX and Linux training, support, and custom software development. He has more than thirty years of experience working with UNIX and Linux systems and is the author of many best-selling books, including A Practical Guide to Red Hat® Linux®, Seventh Edition, and A Practical Guide to Linux® Commands, Editors, and Shell Programming, Third Edition, both from Prentice Hall.
“I have said before on several occasions that Sobell does really good work. Well, [A Practical Guide to Ubuntu Linux®, Third Edition,] holds true to my words. This is a big book with some 1250+ pages in it absolutely filled to the brim with useful information. The review on the front cover mentions that the book is ‘comprehensive’ and that just might be understating it a little. This book has practically anything you might want to know about Ubuntu, and references a lot of really helpful general Linux and userland program information and it’s put together in a very straight forward and understandable way. Having the word ‘Practical’ in the name is also a really good fit as the book offers great walk-throughs on things people will want to do with their Ubuntu install from beginner things like configuring a printer all the way up to things like some Perl programming and running your own Web server. All in all, this book is not only worth a look, but it is a keeper. It’s a good read and great technical reference.” —Lincoln C. Fessenden, Linux Guy / I.T. Manager “The third updated edition of A Practical Guide to Ubuntu Linux® offers a fine reference perfect for any Ubuntu Linux computer collection, packing in hundreds of practical applications for Ubuntu with keys to security, Perl scripting, common administration tasks, and more. From keeping Ubuntu systems current to handling configuration issues, this is a solid reference to the latest Ubuntu applications and challenges.” —Jim Cox, Midwest Book Review “This is an excellent text and I am using it as of this term as the textbook for the class in Linux that I am teaching at the local Community College. The first book on UNIX that I used twenty-five years ago was written by Sobell. He hasn’t lost his touch.” —James J. Sherin, Part-Time Faculty, Westmoreland County Community College “When I first started working with Linux just a short 10 years or so ago, it was a little more difficult than now to get going. . . . Now, someone new to the community has a vast array of resources available on the web, or if they are inclined to begin with Ubuntu, they can literally find almost every single thing they will need in the single volume of Mark Sobell’s A Practical Guide to Ubuntu Linux®. “Overall, I think it’s a great, comprehensive Ubuntu book that’ll be a valuable resource for people of all technical levels.” —John Dong, Ubuntu Forum Council Member, Backports Team Leader “I would so love to be able to use this book to teach a class about not just Ubuntu or Linux but about computers in general. It is thorough and well written with good illustrations that explain important concepts for computer usage.” —Nathan Eckenrode, New York Local Community Team “Ubuntu is gaining popularity at the rate alcohol did during Prohibition, and it’s great to see a well-known author write a book on the latest and greatest version. Not only does it contain Ubuntu-specific information, but it also touches on general computer-related topics, which will help the average computer user to better understand what’s going on in the background. Great work, Mark!” —Daniel R. Arfsten, Pro/ENGINEER Drafter/Designer “This is well-written, clear, comprehensive information for the Linux user of any type, whether trying Ubuntu on for the first time and wanting to know a little about it, or using the book as a very good reference when doing something more complicated like setting up a server. This book’s value goes well beyond its purchase price and it’ll make a great addition to the Linux section of your bookshelf.” —Linc Fessenden, Host of The LinuxLink TechShow, tllts.org “Overall, A Practical Guide to Ubuntu Linux® by Mark G. Sobell provides all of the information a beginner to intermediate user of Linux would need to be productive. The inclusion of the Live DVD of Ubuntu makes it easy for the user to test-drive Linux without affecting his installed OS. I have no doubts that you will consider this book money well spent.” —Ray Lodato, Slashdot contributor, www.slashdot.org “I’m sure this sounds a bit like hyperbole. Everything a person would need to know? Obviously not everything, but this book, weighing in at just under 1200 pages, covers so much so thoroughly that there won’t be much left out. From install to admin, networking, security, shell scripting, package management, and a host of other topics, it is all there. GUI and command line tools are covered. There is not really any wasted space or fluff, just a huge amount of information. There are screen shots when appropriate but they do not take up an inordinate amount of space. This book is information-dense.” —JR Peck, Editor, GeekBook.org “Sobell tackles a massive subject, the vast details of a Linux operating system, and manages to keep the material clear, interesting and engaging. . . . If you want to know how to get the most out of your Red Hat, Fedora, or CentOS system, then this is one of the best texts available, in my opinion.” —Jesse Smith, Feature Writer for DistroWatch “I had the chance to use your UNIX books when I when was in college years ago at Cal Poly, San Luis Obispo, CA. I have to say that your books are among the best! They’re quality books that teach the theoretical aspects and applications of the operating system.” —Benton Chan, IS Engineer “I currently own one of your books, A Practical Guide to Linux®. I believe this book is one of the most comprehensive and, as the title says, practical guides to Linux I have ever read. I consider myself a novice and I come back to this book over and over again.” —Albert J. Nguyen “The book has more than lived up to my expectations from the many reviews I read, even though it targets FC2. I have found something very rare with your book: It doesn’t read like the standard technical text, it reads more like a story. It’s a pleasure to read and hard to put down. Did I say that?! :-)” —David Hopkins, Business Process Architect “Thanks for your work and for the book you wrote. There are really few books that can help people to become more efficient administrators of different workstations. We hope (in Russia) that you will continue bringing us a new level of understanding of Linux/UNIX systems.” —Anton Petukhov “Mark Sobell has written a book as approachable as it is authoritative.” —Jeffrey Bianchine, Advocate, Author, Journalist “Since I’m in an educational environment, I found the content of Sobell’s book to be right on target and very helpful for anyone managing Linux in the enterprise. His style of writing is very clear. He builds up to the chapter exercises, which I find to be relevant to real-world scenarios a user or admin would encounter. An IT/IS student would find this book a valuable complement to their education. The vast amount of information is extremely well balanced and Sobell manages to present the content without complicated asides and meandering prose. This is a ‘must have’ for anyone managing Linux systems in a networked environment or anyone running a Linux server. I would also highly recommend it to an experienced computer user who is moving to the Linux platform.” —Mary Norbury, IT Director, Barbara Davis Center, University of Colorado at Denver, from a review posted on slashdot.org “Excellent reference book, well suited for the sysadmin of a Linux cluster, or the owner of a PC contemplating installing a recent stable Linux. Don’t be put off by the daunting heft of the book. Sobell has striven to be as inclusive as possible, in trying to anticipate your system administration needs.” —Wes Boudville, Inventor “The JumpStart sections really offer a quick way to get things up and running, allowing you to dig into the details of the book later.” —Scott Mann, Aztek Networks “A Practical Guide to Red Hat® Linux® is a brilliant book. Thank you Mark Sobell.” —C. Pozrikidis, University of California at San Diego “Overall I found this book to be quite excellent, and it has earned a spot on the very front of my bookshelf. It covers the real ‘guts’ of Linux—the command line and its utilities—and does so very well. Its strongest points are the outstanding use of examples, and the Command Reference section. Highly recommended for Linux users of all skill levels. Well done to Mark Sobell and Prentice Hall for this outstanding book!” —Dan Clough, Electronics Engineer and Slackware Linux User “This book presents the best overview of the Linux operating system that I have found. . . . [It] should be very helpful and understandable no matter what the reader’s background: traditional UNIX user, new Linux devotee, or even Windows user. Each topic is presented in a clear, complete fashion and very few assumptions are made about what the reader knows. . . . The book is extremely useful as a reference, as it contains a 70-page glossary of terms and is very well indexed. It is organized in such a way that the reader can focus on simple tasks without having to wade through more advanced topics until they are ready.” —Cam Marshall, Marshall Information Service LLC, Member of Front Range UNIX, Users Group [FRUUG], Boulder, Colorado “Conclusively, this is THE book to get if you are a new Linux user and you just got into RH/Fedora world. There’s no other book that discusses so many different topics and in such depth.” —Eugenia Loli-Queru, Editor in Chief, OSNews.com “This book is a very useful tool for anyone who wants to ‘look under the hood’ so to speak, and really start putting the power of Linux to work. What I find particularly frustrating about man pages is that they never include examples. Sobell, on the other hand, outlines very clearly what the command does and then gives several common, easy-to-understand examples that make it a breeze to start shell programming on one’s own. As with Sobell’s other works, this is simple, straight-forward, and easy to read. It’s a great book and will stay on the shelf at easy arm’s reach for a long time.” —Ray Bartlett, Travel Writer “Totally unlike most Linux books, this book avoids discussing everything via GUI and jumps right into making the power of the command line your friend.” —Bjorn Tipling, Software Engineer, ask.com “This book is the best distro-agnostic, foundational Linux reference I’ve ever seen, out of dozens of Linux-related books I’ve read. Finding this book was a real stroke of luck. If you want to really understand how to get things done at the command line, where the power and flexibility of free UNIX-like OSes really live, this book is among the best tools you’ll find toward that end.” —Chad Perrin, Writer, TechRepublic “Thank you for writing a book to help me get away from Windows XP and to never touch Windows Vista. The book is great; I am learning a lot of new concepts and commands. Linux is definitely getting easier to use.” —James Moritz “I am so impressed by how Mark Sobell can approach a complex topic in such an understandable manner. His command examples are especially useful in providing a novice (or even an advanced) administrator with a cookbook on how to accomplish real-world tasks on Linux. He is truly an inspired technical writer!” —George Vish II, Senior Education Consultant, Hewlett-Packard Company “I read a lot of Linux technical information every day, but I’m rarely impressed by tech books. I usually prefer online information sources instead. Mark Sobell’s books are a notable exception. They’re clearly written, technically accurate, comprehensive, and actually enjoyable to read.” —Matthew Miller, Senior Systems Analyst/Administrator, BU Linux Project, Boston University Office of Information Technology “The author has done a very good job at clarifying such a detail-oriented operating system. I have extensive Unix and Windows experience and this text does an excellent job at bridging the gaps between Linux, Windows, and Unix. I highly recommend this book to both ‘newbs’ and experienced users. Great job!” —Mark Polczynski, Information Technology Consultant “I have been wanting to make the jump to Linux but did not have the guts to do so—until I saw your familiarly titled A Practical Guide to Red Hat® Linux® at the bookstore. I picked up a copy and am eagerly looking forward to regaining my freedom.” —Carmine Stoffo, Machine and Process Designer to the pharmaceutical industry “I am currently reading A Practical Guide to Red Hat® Linux® and am finally understanding the true power of the command line. I am new to Linux and your book is a treasure.” —Juan Gonzalez
Ask a Question About this Product More... |