Linux all in one desk reference for dummies phần 1 pot - Pdf 19


Linux
®
All-in-One DESK REFERENCE
FOR
DUMmIES

TEAM LinG - Live, Informative, Non-cost and Genuine !
TEAM LinG - Live, Informative, Non-cost and Genuine !
by Naba Barkakati
Linux
®
All-in-One DESK REFERENCE
FOR
DUMmIES

TEAM LinG - Live, Informative, Non-cost and Genuine !
Linux
®
All-in-One Desk Reference For Dummies
®
Published by
Wiley Publishing, Inc.
111 River Street
Hoboken, NJ 07030-5774
Copyright © 2005 by Wiley Publishing, Inc., Indianapolis, Indiana
Published by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or
by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permit-
ted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written per-

Library of Congress Control Number: 2004116155
ISBN: 0-7645-7936-3
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
1O/QU/QR/QV/IN
TEAM LinG - Live, Informative, Non-cost and Genuine !
About the Author
Naba Barkakati is an electrical engineer and a successful computer-book
author who has experience in a wide variety of systems, ranging from MS-DOS
and Windows to UNIX and Linux. He bought his first personal computer —
an IBM PC-AT — in 1984 after graduating with a PhD in electrical engineering
from the University of Maryland at College Park. While pursuing a full-time
career in engineering, Naba dreamed of writing software for the emerging PC
software market. As luck would have it, instead of building a software empire
like Microsoft, he ended up writing successful computer books. Currently,
Naba is a Senior Level Technologist at the Center for Technology and
Engineering in the U.S. Government Accountability Office (GAO).
Over the past 15 years, Naba has written over 25 computer books on a
number of topics, ranging from Windows programming with C++ to Linux.
He has authored several best-selling titles, such as The Waite Group’s Turbo
C++ Bible, Object-Oriented Programming in C++, X Window System Programming,
Visual C++ Developer’s Guide, Borland C++ 4 Developer’s Guide, and Linux Secrets.
His books have been translated into many languages, including Spanish, French,
Polish, Greek, Italian, Chinese, Japanese, and Korean. Naba’s most recent book
is Red Hat Fedora Linux 2 All-in-One Desk Reference For Dummies, also published
by Wiley Publishing, Inc.
Naba lives in North Potomac, Maryland, with his wife Leha, and their children,
Ivy, Emily, and Ashley.
TEAM LinG - Live, Informative, Non-cost and Genuine !
TEAM LinG - Live, Informative, Non-cost and Genuine !

Technical Editor: Jason Luster
Editorial Manager: Kevin Kirschner
Permissions Editor: Laura Moss
Media Development Specialist: Travis Silvers
Media Development Manager:
Laura VanWinkle
Media Development Supervisor:
Richard Graves
Editorial Assistant: Amanda Foxworth
Cartoons: Rich Tennant (
www.the5thwave.com)
Production
Project Coordinator: Nancee Reeves
Layout and Graphics: Andrea Dahl,
Denny Hager, Joyce Haughey,
Stephanie D. Jumper, Heather Ryan,
Jacque Roth
Proofreaders: Laura Albert, John Greenough,
Jessica Kramer, Arielle Mennelle,
Carl Pierce, Dwight Ramsey
Indexer: Sherry Massey
Special Help: Teresa Artman, Virginia Sanders
Publishing and Editorial for Technology Dummies
Richard Swadley, Vice President and Executive Group Publisher
Andy Cummings, Vice President and Publisher
Mary Bednarek, Executive Acquisitions Director
Mary C. Corder, Editorial Director
Publishing for Consumer Dummies
Diane Graves Steele, Vice President and Publisher
Joyce Pepple, Acquisitions Director

Chapter 3: Managing File Systems 397
Chapter 4: Installing and Updating Applications 421
Chapter 5: Customizing the Linux Kernel 445
TEAM LinG - Live, Informative, Non-cost and Genuine !
Book VI: Security 469
Chapter 1: Introducing Linux Security 471
Chapter 2: Securing a Linux Host 485
Chapter 3: Improving Network Security 501
Chapter 4: Performing Computer Security Audits 517
Book VII: Internet Servers 533
Chapter 1: Managing Internet Services 535
Chapter 2: Running a Web Server 551
Chapter 3: Setting Up the FTP Server 573
Chapter 4: Managing Mail and News Servers 579
Chapter 5: Managing DNS 603
Chapter 6: Using Samba and NFS 623
Book VIII: Programming 631
Chapter 1: Programming in Linux 633
Chapter 2: Programming in C 659
Chapter 3: Writing Shell Scripts 691
Chapter 4: Programming in Perl 703
Appendix: About the DVD 731
Index 737
TEAM LinG - Live, Informative, Non-cost and Genuine !
Table of Contents
Introduction 1
About This Book 2
Conventions Used in This Book 3
What You Don’t Have to Read 3
Who Are You? 3

TEAM LinG - Live, Informative, Non-cost and Genuine !
Linux All-in-One Desk Reference For Dummies
xii
Checking Your PC’s Hardware 32
Setting Aside Space for Linux 34
Trying Out Knoppix Live CD 35
Installing Debian GNU/Linux 36
Getting an overview of the installation 36
Completing the Debian installation 37
Installing Fedora Core 41
Selecting keyboard and installation type 42
Partitioning the hard drive for Fedora Core 43
Setting up key system parameters 44
Selecting and installing the package groups 48
Installing SUSE Linux 50
Performing an FTP install 51
Installing SUSE Linux from CDs or DVD 54
Installing Xandros Desktop 62
Using Xandros Express Install 64
Using Xandros Custom Install 66
Chapter 3: Troubleshooting and Configuring Linux . . . . . . . . . . . . . . .71
Using Text Mode Installation 71
Disabling Hardware Probing in Fedora 72
Troubleshooting X 73
Resolving Other Installation Problems 75
Using Knoppix boot commands 75
The fatal signal 11 error 77
Using Linux kernel boot options 78
Setting Up Printers 81
Configuring printers in Debian 81

Introducing Debian’s KDE Desktop 131
Introducing Fedora Core’s GNOME Desktop 134
Introducing the Knoppix Desktop 136
Introducing the SUSE Desktop 140
Introducing the Xandros Desktop 142
Chapter 2: Commanding the Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145
Opening Terminal Windows and Virtual Consoles 145
Using the Bash Shell 146
Understanding the syntax of shell commands 146
Combining shell commands 148
Controlling command input and output 148
Typing less with automatic command completion 150
Going wild with asterisks and question marks 150
Repeating previously typed commands 152
Discovering and Using Linux Commands 153
Becoming root (superuser) 156
Managing processes 157
Working with date and time 158
Processing files 159
Writing Shell Scripts 162
Chapter 3: Navigating the Linux File System . . . . . . . . . . . . . . . . . . . .165
Understanding the Linux File System 165
Using GUI File Managers 170
Using the Nautilus shell 170
Using Konqueror 175
TEAM LinG - Live, Informative, Non-cost and Genuine !
Linux All-in-One Desk Reference For Dummies
xiv
Navigating the File System with Linux Commands 179
Commands for directory navigation 179

Gnome Ghostview 219
Chapter 5: Using Text Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221
Using GUI Text Editors 221
Text Editing with ed and vi 222
Using ed 223
Using vi 226
TEAM LinG - Live, Informative, Non-cost and Genuine !
Table of Contents
xv
Book III: Networking 231
Chapter 1: Connecting to the Internet . . . . . . . . . . . . . . . . . . . . . . . . . .233
Understanding the Internet 233
Deciding How to Connect to the Internet 234
Connecting with DSL 236
How DSL works 236
DSL alphabet soup: ADSL, IDSL, SDSL 237
Typical DSL setup 238
Connecting with a Cable Modem 242
How cable modem works 242
Typical cable modem setup 244
Setting Up Dialup Networking 247
Connecting the modem 248
Setting up and activating a PPP connection 250
Configuring CHAP and PAP authentication 252
Chapter 2: Setting Up a Local Area Network . . . . . . . . . . . . . . . . . . .255
Understanding TCP/IP 255
TCP/IP and the Internet 257
IP addresses 258
Internet services and port numbers 258
Setting Up an Ethernet LAN 259

Book IV: Internet 289
Chapter 1: E-Mailing and IMing in Linux . . . . . . . . . . . . . . . . . . . . . . .291
Understanding Electronic Mail 292
How MUA and MTA work 292
Mail message enhancements 294
Taking Stock of Mail Readers and IM Clients in Linux 294
E-Mailing in Linux 295
Introducing Ximian Evolution 295
Introducing Mozilla Mail 299
Introducing KMail 303
Instant Messaging in Linux 305
Using Gaim 305
Using Kopete 307
Chapter 2: Browsing the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .309
Discovering the World Wide Web 309
Like a giant spider’s web 310
Links and URLs 310
Web servers and Web browsers 313
Web Browsing in Linux 314
Checking out Web browsers for Linux 315
Learning Mozilla’s user interface 315
Changing your home page 318
Surfing the Net with Mozilla 319
Introducing Epiphany and Firefox 320
Chapter 3: Reading Newsgroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .323
Understanding Newsgroups 323
Newsgroup hierarchy 324
Top-level newsgroup categories 325
Linux-related newsgroups 326
TEAM LinG - Live, Informative, Non-cost and Genuine !

Understanding the init process 358
Examining the /etc/inittab file 360
Trying a new run level with the init command 361
Understanding the Linux startup scripts 362
Manually starting and stopping servers 363
Automatically starting servers at system startup 363
Taking Stock of Linux System Configuration Files 364
Monitoring System Performance 367
Using the top utility 367
Using the uptime command 369
Using the vmstat utility 370
Checking disk performance and disk usage 371
Viewing System Information via the /proc File System 372
TEAM LinG - Live, Informative, Non-cost and Genuine !
Linux All-in-One Desk Reference For Dummies
xviii
Understanding Linux Devices 375
Device files 375
Persistent device naming with udev 377
Managing Loadable Driver Modules 378
Loading and unloading modules 378
Using the /etc/modprobe.conf file 380
Scheduling Jobs in Linux 381
Scheduling one-time jobs 381
Scheduling recurring jobs 383
Chapter 2: Managing Users and Groups . . . . . . . . . . . . . . . . . . . . . . . .387
Adding User Accounts 387
Using a GUI User Manager to add user accounts 388
Using commands to manage user accounts 390
Understanding the /etc/passwd File 391

xix
Installing an RPM 425
Removing an RPM 426
Upgrading an RPM 427
Verifying an RPM 427
Working with DEB Files 428
Understanding DEB filenames 429
Using the dpkg command 429
Introducing dselect 431
Using APT to manage DEB packages 432
Building Software Packages from Source Files 433
Downloading and unpacking the software 433
Building the software from source files 434
Installing SRPMS 436
Updating Linux Applications Online 437
Keeping Debian updated with APT 437
Updating Fedora Core Applications 438
Updating SUSE online 441
Using Xandros Networks 442
Chapter 5: Customizing the Linux Kernel . . . . . . . . . . . . . . . . . . . . . . .445
Rebuilding the Kernel 445
Creating a monolithic versus a modular kernel 447
Configuring the kernel 447
Building the Kernel and the Modules 463
Installing the Modules 463
Creating the Initial RAM Disk File 464
Installing the New Kernel and Setting Up GRUB 464
Rebooting the System 466
Book VI: Security 469
Chapter 1: Introducing Linux Security . . . . . . . . . . . . . . . . . . . . . . . . .471

Chapter 3: Improving Network Security . . . . . . . . . . . . . . . . . . . . . . . .501
Securing Internet Services 501
Turning off standalone services 502
Configuring the Internet super server 502
Configuring TCP wrapper security 503
Using Secure Shell (SSH) for Remote Logins 504
Setting Up Simple Firewalls 506
Using NATs 510
Enabling packet filtering on your Linux system 510
Chapter 4: Performing Computer Security Audits . . . . . . . . . . . . . . . .517
Understanding Security Audits 517
Non-technical aspects of security audits 518
Technical aspects of security audits 519
Implementing a Security Test Methodology 519
Some common computer vulnerabilities 520
Host-security review 522
Network-security review 525
Exploring Security Testing Tools 528
nmap 528
Nessus 529
Book VII: Internet Servers 533
Chapter 1: Managing Internet Services . . . . . . . . . . . . . . . . . . . . . . . .535
Understanding Internet Services 535
TCP/IP and sockets 536
Internet services and port numbers 539
TEAM LinG - Live, Informative, Non-cost and Genuine !
Table of Contents
xxi
Using the Internet Super Server 541
Using inetd 541

The sendmail alias file 593
Installing the INN Server 593
Configuring and Starting the INN Server 594
InterNetNews components 595
The incoming.conf file 599
The readers.conf file 599
InterNetNews startup 600
Setting Up Local Newsgroups 600
Defining a newsgroup hierarchy 601
Updating configuration files 601
TEAM LinG - Live, Informative, Non-cost and Genuine !
Linux All-in-One Desk Reference For Dummies
xxii
Adding the newsgroups 602
Testing your newsgroups 602
Chapter 5: Managing DNS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .603
Understanding Domain Name System (DNS) 603
What is DNS? 603
Discovering hierarchical domain names 605
Exploring Berkeley Internet Name Domain (BIND) 606
Configuring DNS 609
Configuring the resolver 609
Configuring a caching name server 611
Configuring a primary name server 620
Chapter 6: Using Samba and NFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . .623
Sharing Files with NFS 623
Exporting a file system with NFS 624
Mounting an NFS file system 626
Setting Up a Windows Server Using Samba 627
Installing Samba 628

Type qualifiers: const and volatile 670
Expressions 671
Operator Precedence 673
Statements 675
The break statement 675
The case statement 676
A compound statement or block 676
The continue statement 676
The default label 677
The do statement 677
Expression statements 677
The for statement 677
The goto statement 678
The if statement 678
The if-else statement 678
The null statement 679
The return statement 679
The switch statement 679
The while statement 680
Functions 681
Function prototypes 681
The void type 682
Functions with a variable number of arguments 682
The C Library 682
Shared Libraries in Linux Applications 684
Examining the shared libraries that a program uses 684
Creating a shared library 685
Dynamically loading a shared library 687
Chapter 3: Writing Shell Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .691
Trying Out Simple Shell Scripts 691

Using the English module 728
Appendix: About the DVD 731
System Requirements 731
DVD Installation Instructions 732
What You’ll Find on the DVD 732
Troubleshooting 735
Index 737
TEAM LinG - Live, Informative, Non-cost and Genuine !


Nhờ tải bản gốc
Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status