red hat: the complete reference enterprise linux & fedora ... · new york chicago san francisco...

23
Red Hat: The Complete Reference Enterprise Linux & Fedora Edition Richard Petersen McGraw-Hill/Osborne New York Chicago San Francisco Ul n Ljo n Lisbon London Madrid Mexico City m m m * Milan NewDelhi San ' uan Se ° ul Sinsapore Sydney Toront °

Upload: others

Post on 23-Apr-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

Red H a t : The Complete ReferenceEnterprise Linux & Fedora Edition

Richard Petersen

McGraw-Hill/OsborneNew York Chicago San Francisco

UlnLjo n Lisbon London Madrid Mexico City

m m m * Milan NewDelhi San'uanS e ° u l Sinsapore Sydney T o r o n t °

Page 2: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

Contents

Acknowledgments i xxviiIntroduction xxix

Parti Getting Started

1 Introduction to Red Hat Linux 3Red Hat and Fedora Linux 5

The Fedora Project 6Red Hat Enterprise Linux 6Red Hat Documentation 7

Red Hat Linux Fedora Core 8Operating Systems and Linux 10History of Linux and Unix 10

Unix 11Linux .." 11

Linux Overview 12Open Source Software 13Linux Software 14

Linux Office and Database Software 15Internet Servers 15Development Resources ; 16

Online Information Sources 18Documentation 19

2 Installing Red Hat and Fedora Core Linux ;. 21Hardware, Software, and Information Requirements .'•. 22

Hardware Requirements '. 22Hard Drive Configuration > 23Information Requirements I 23

Creating the Boot Disks 25

Page 3: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

V J R e d H a t : T h e C o m p l e t e R e f e r e n c e E n t e r p r i s e L i n u x & F e d o r a E d i t i o n

Installing Linux 27Starting the Installation Program 27Partitions, RAID, and Logical Volumes 28Boot Loaders 30Network Configuration 30System Configuration 31Software Installation 31X Window System Configuration (Red Hat only) 32

Finishing Installation 33Setup 33Login and Logout 34Boot Disks 35

3 Interface Basics 37User Accounts 37Accessing Your Linux System 38

The Display Manager: GDM 38Accessing Linux from the Command Line Interface 39

Bluecurve: The GNOME and KDE Desktops 41GNOME 41KDE 42Window Managers for Linux 43

Command Line Interface 43Help 44

4 Red Hat System Configuration 47Red Hat Administrative Tools 47Configuring Users 48Printer Configuration 50X Window System Configuration: redhat-config-xfree86 52Updating Red Hat and Fedora Linux with RHN, Yum and APT . . . 52Installing Software Packages 54

Installing Packages with redhat-config-packages 55Installing Packages with the rpm Command 57Package Security Check 58Installing Source Code Applications 59

Security Configuration 60Security Services 60Authentication Configuration 63

Unsupported Drivers 63Bluetooth 64

Bluetooth Configuration 65Personal Area Networks: PAN 65

Page 4: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

C o n t e n t s VM

5 Red Hat Network Configuration 67Network Information: Dynamic and Static 68Network Configuration with Red Hat Network Tools 69

redhat-config-network 69Network Device Control 73The Internet Configuration Wizard 73Virtual Private Networks 75Interface Configuration Scripts:

/etc/sysconfig/network-scripts 75Command Line PPP Access: wvdial 76Wireless Tools 78

iwconfig 78iwpriv 79iwspy 80iwlist 80linux-wlan 80

Setting Up Your Firewall: redhat-config-securitylevel 81Configuring a Local Area Network 82

Physical Configuration 83IP Addressing 83Assigning IP Addresses: static and dynamic 84Squid Proxy Server 86Implementing a DNS Server 86Configuring the DNS Server with redhat-config-bind 88

Part II Environments

6 GNOME 95GNOME Enhancements 96GTK+ 97The GNOME Interface 97

GNOME Components 98Start Here Window 99Quitting GNOME 99GNOME Help 99

The GNOME Desktop 100Drag and Drop 100Application Links 100Desktop Drive Icons 101Desktop Menu 101Window Manager 102

The GNOME File Manager: Nautilus 102Nautilus Window 102Nautilus Sidebar: Tree, History, and Notes 103

Page 5: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

V J i i R e d H a t : T h e C o m p l e t e R e f e r e n c e E n t e r p r i s e L i n u x & F e d o r a E d i t i o n

Nautilus Views 103Nautilus Menu 104Navigating Directories 104Managing Files 105File and Directory Properties 106Nautilus Preferences 107Nautilus as a Web Browser 107

The GNOME Panel 108Panel Properties 108Displaying Panels 109Adding Panels 109Panel Objects 109Special Panel Objects I l l

GNOME Applets I l lWorkspace Switcher 112GNOME Tasklist 112

GNOME Configuration 112GNOME Directories and Files 113

GNOME User Directories 114GConf 114

7 The K Desktop Environment: KDE 115Qt Library 117KDE Desktop 117

KDE Menus 118Quitting KDE 118KDE Desktop Operations 119Configuring Your Desktop 119Desktop Files 120KDE Windows 121Virtual Desktops: The KDE Desktop Pager 122KDE Panel: Kicker 123

The KDE Help Center 124Applications 124

Application Standard Links 124Application Desktop Links 125

Mounting CD-ROMs and Floppy Disks from the Desktop 125KDE File Manager and Internet Client: Konqueror 126

Konqueror Window 126Navigation Panel 127Search 128Navigating Directories 128Copy, Move, Delete, Rename, and Link Operations 129Web and FTP Access 130

Page 6: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

C o n t e n t s ix

KDE Configuration: KDE Control Center 130.kde and Desktop User Directories 132MIME Types and Associated Applications 132KDE Directories and Files 132

8 The Shell 135The Command Line 135

Command Line Editing 136Command and Filename Completion 137

History 137History Events 138History Event Editing 140Configuring History: HISTFILE and HISTSAVE 141

Filename Expansion: *,?,[] 141Matching Multiple Characters 142Matching Single Characters 143Matching a Range of Characters 143Matching Shell Symbols 144Generating Patterns 144

Standard Input/Output and Redirection 145Redirecting the Standard Output: > and » 145The Standard Input 148

Pipes: I 148Redirecting and Piping the Standard Error: >&, 2> 149Jobs: Background, Kills, and Interruptions 150

Running Jobs in the Background 150Job Notification 151Bringing Jobs to the Foreground 152Stopping and Suspending Jobs 152

Shell Variables 153Definition and Evaluation of Variables: =, $, set, unset 153

Shell Scripts: User-Defined Commands 155Executing Scripts 155Script Arguments 155

Control Structures 156Test Operations 157Conditional Control Structures 158Loop Control Structures 160

Filters and Regular Expressions 161Searching Files: grep 162Regular Expressions 163

9 Shell Configuration 165Aliases 165

Aliasing Commands and Options 166

Page 7: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

R e d H a t : T h e C o m p l e t e R e f e r e n c e E n t e r p r i s e L i n u x & F e d o r a E d i t i o n

Aliasing Commands and Arguments 166Aliasing Commands 167

Controlling Shell Operations 167Environment Variables and Subshells: export 169Configuring Your Shell with Shell System Variables 169

System Variables 170Configuring Your Login Shell: .bash_profile 174Configuring the BASH Shell: .bashrc 177The BASH Shell Logout File: .bashjogout 178Initialization and Configuration Files 178Configuration Directories and Files 179

10 Managing Linux Files, Directories, and Archives 181Linux Files 182The File Structure 184

Home Directories 185Pathnames 185System Directories 186

Listing, Displaying, and Printing Files:Is, cat, more, less, and lpr 187

Displaying Files: cat, less, and more 188Printing Files: lpr, lpq, and lprm 188

Managing Directories: mkdir, rmdir, Is, cd, and pwd 189Creating and Deleting Directories 190Displaying Directory Contents 190Moving Through Directories 191Referencing the Parent Directory 191

File and Directory Operations: find, cp, mv, rm, and In 192Searching Directories: find 192Copying Files 193Moving Files 195Copying and Moving Directories 196Erasing Files and Directories: the rm Command 196Links: the In Command 197

- The mtools Utilities: msdos 199Copying Files to a DOS Floppy 199mtools Commands 200Configuring mtools: /etc/ mtools.conf 201Copying Files to a DOS Partition 202

Archiving and Compressing Files 202Archiving and Compressing Files with File Roller 202

Archive Files and Devices: tar 203File Compression: gzip, bzip2, and zip 207

Page 8: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

Contents xi

Part 111 Applications

11 Office and Database Applications 213Accessibility to Microsoft Office 214OpenOffice 214KOffice 216

KOffice Applications 216KParts 217

GNOME Office and Ximian 217Document Viewers (PostScript, PDF, and DVI) 219Database Management Systems 220

SQL Databases (RDMS) 220Xbase Databases 223

Editors 223GNOME Editor: gedit 224K Desktop Editors: Kate, KEdit, and KJots 225The Emacs Editor 225The Vi Editor: Vim and gvim 226

12 Graphics Tools and Multimedia 231Graphics Tools 232

KDE Graphics Tools 232GNOME Graphics Tools 232X Window System Graphic Programs 233

Multimedia 234Sound Applications 234CD Burners 235Video Applications 236

13 Mail and News Clients 237Mail Clients 237

MIME 238Evolution 239GNOME Mail Clients: Evolution, Balsa, and Others 240The K Desktop Mail Client: KMail 241X Mail Clients: Mozilla and Emacs 241Command Line Mail Clients 242Notifications of Received Mail 245Accessing Mail on Remote POP Mail Servers 246

Usenet News 247News Transport Agents 250Mailing Lists 250Newsreaders 251

Page 9: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

X J i R e d H a t : T h e C o m p l e t e R e f e r e n c e E n t e r p r i s e L i n u x & F e d o r a E d i t i o n

14 Web, FTP, and Java Clients 253Web Clients 254

URL Addresses 254Web Browsers 256Creating Your Own Web Site 259

Java for Linux: Blackdown 260The Java 2 Software Development Kit: SDK 261

FTP Clients 262Network File Transfer: FTP 262Web Browser-Based FTP: Mozilla 263The K Desktop File Manager: Konqueror 263GNOME Desktop FTP: Nautilus 264gFTP 264NcFTP 265NcFTP Download Features 268Bookmarks and Macros 269ftp 270Automatic Login and Macros: .netrc 274lftp 276

15 Network Tools 277Network Information: ping, finger, traceroute, and host 277

ping 277finger and who 278host 279traceroute 279

Network Talk and Messenger Clients: ICQ, IRC, AIM, and Talk . . . 280ICQ 281Instant Messenger 281

Telnet 282RSH, Kerberos, and SSH Remote Access Commands 283

Remote Access Permission: .rhosts and .k51ogin 284rlogin, slogin, rep, scp, rsh, and ssh 284

Part IV Security

16 Encryption, Integrity Checks, and Signatures:GNU Privacy Guard 289

Public Key Encryption, Integrity Checks, and Digital Signatures .. 289Public-Key Encryption 289Digital Signatures 290Integrity Checks 290Combining Encryption and Signatures 290

Page 10: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

C o n t e n t s XMJ

GNU Privacy Guard 291GnuPG Setup:gpg 293Using GnuPG 296

Checking Software Package Digital Signatures 298Importing Public Keys 299Validating Public Keys 299Checking RPM Packages 300

Intrusion Detection: Tripwire 301

17 Internet Protocol Security: IPsec 303IPsec Protocols 303IPsec Modes 304IPsec Security Databases 304

IPsec Tools 304IPsec and IP Tables 305

Configuring IPsec with redhat-config-network 305Configuring Connections with setkey 306

Security Associations: SA 307Security Policy: SP 307Receiving Hosts 308Two-way Transmissions 308

Configuring IPsec with racoon: IKE 309Certificates 310Connection Configuration with racoon 310

IPsec Tunnel Mode: Virtual Private Networks 310Crypto IP Encapsulation for Virtual Private Networks 312

18 Secure Shell and Kerberos 313The Secure Shell: OpenSSH 313

SSH Encryption and Authentication 314SSH Tools 315SSH Setup 316SSH Clients 318Port Forwarding (Tunneling) 321SSH Configuration 322

Kerberos 323Kerberos Servers 323Authentication Process 324Kerberized Services 325Configuring Kerberos Servers 325

19 Network Firewalls: Netfilter 327Firewalls: iptables and NAT 328Packet Filtering 329

Chains 329Targets 330

Page 11: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

X J V R e d H a t : T h e C o m p l e t e R e f e r e n c e E n t e r p r i s e L i n u x & F e d o r a E d i t i o n

Firewall Chains 330Adding and Changing Rules 331iptables Options 332Accepting and Denying Packets: DROP and ACCEPT 333User-Defined Chains 334ICMP Packets 335Controlling Port Access 336Packet States: Connection Tracking 337

Network Address Translation (NAT) 338Adding NAT Rules 338Nat Targets and Chains 339Nat Redirection: Transparent Proxies 340Packet Mangling: the Mangle Table 340

IP Tables Scripts 341Red Hat iptables Support 341An iptables Script Example 343

IP Masquerading 349Masquerading Local Networks 350Masquerading NAT Rule 350IP Forwarding 351Masquerading Selected Hosts 351

Part V Red Hat Servers

20 Server Management 355System Startup Files: /etc/red and /etc/sysconfig 355

/etc/rc.d/rc.sysinit 355/etc/rc.d/init.d 355

SysV Init: init.d Scripts 357Starting Servers: Standalone and xinetd 359

Starting Services Directly 359Starting and Stopping Services with Startup Scripts 359Starting Services Automatically 359

Service Management Tools: chkeonfig and redhat-config-serivces . . . 360redhat-config-services 361chkeonfig 362

Service Scripts: /etc/init.d 365Service Script Functions 365Service Script Tags 366Service Script Example 367Installing Service Scripts 368

Extended Internet Services Daemon (xinetd) 368Starting and Stopping xinetd Services 369xinetd Configuration: xinetd.conf 369

Page 12: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

C o n t e n t s XV

xinetd Attributes 369Disabling and Enabling xinetd Services 372Logging xinetd Services 373xinetd Network Security 374xinetd Defaults and Internal Services 374Service Files in xinetd.d Directory 374TCP Wrappers 375

21 FTP Servers 377FTP Servers 377

Available Servers 378Red Hat FTP Server Directories 378FTP Users . . . . ; 379

Anonymous FTP: vsftpd 379The FTP User Account: anonymous 380

FTP Group 380Creating New FTP Users 380Anonymous FTP Server Directories 381Anonymous FTP Files 381

The Very Secure FTP Server 382Running vsftpd 382Configuring vsftpd 383vsftpd Access Controls 386vsftpd Virtual Hosts 388vsftpd Virtual Users 388

Professional FTP Daemon: ProFTPD 389install and startup 389proftpd.config and .ftpaccess 390Authentication 392Anonymous Access 392Virtual FTP Servers 395

The Washington University FTP Daemon: WU-FTPD 398ProFTPD and WU-FTPD Server Tools 399

ftpshut 399ftpwho and ftpcount 400

22 Web Servers: Apache 401Tux 401Apache Web Server 402

Java: Apache Jakarta Project 403Linux Apache Installations 403Apache Web Server 2.0 405Starting and Stopping the Web Server 406

Apache Configuration Files 408

Page 13: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

X V i R e d H a t : T h e C o m p l e t e R e f e r e n c e E n t e r p r i s e L i n u x & F e d o r a E d i t i o n

Apache Configuration and Directives 408Server Configuration 410Directory-Level Configuration: .htaccess and <Directory> . . . 413Access Control 415URL Pathnames 417MIME Types 417CGI Files 418Automatic Directory Indexing 419Authentication 420Log Files 422

Virtual Hosting on Apache 425IP Address-Based Virtual Hosts 425Name-Based Virtual Hosts 426Dynamic Virtual Hosting 427

Server-Side Includes 430PHP 431Apache GUI Configuration Tools 431Web Server Security: SSL 433

23 Proxy Servers: Squid 437Configuring Client Browsers 438squid.conf 439Security 440Caches 443Logs 443Web Server Acceleration: Reverse Proxy Cache 443

24 Mail Servers: SMTP, POP, and IMAP 445Mail Servers 446Received Mail: MX Records 447Postfix 448

Postfix Commands 448Postfix Configuration: main.cf 448Security: UCM 451

Sendmail 452Aliases and LDAP 455Sendmail Configuration 456Sendmail Masquerading 460Configuring Mail Servers and Mail Clients 462Configuring Sendmail for a Simple Network Configuration . . . 462Configuring Sendmail for a Centralized Mail Server 463Configuring a Workstation with Direct ISP Connection . . . . 463The Mailer Table 464Security 464

Page 14: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

C o n t e n t s XVN

POP Servers 467Washington POP Server 468Qpopper 468

IMAP 469

25 Print Servers 471CUPS and LPRng 471Printer Devices and Configuration 471

Printer Device Files 472Spool Directories 472

Managing Printers with CUPS 472Installing Printers with CUPS 473Configuring Remote Printers on CUPS 474CUPS Printer Classes 475CUPS Configuration 475CUPS Command Line Print Clients 476CUPS Administrative Tools 478

The Line Printer Server: LPRng 480LPRng Print Clients 481printcap File 481Configuring lpd 481LPRng Print Clients 483

26 News and Search Servers 485News Servers: INN 485

INN Configuration Files 485inn.conf 486INN Implementation 487

Dig Server 487Dig Searches 488Dig Configuration 488Dig Tools 488

Part VI System Administration

27 Basic System Administration 491Superuser Control: the Root User 491

Root User Password 492Root User Access: su 492

System Time and Date 494Using the redhat-config-date Utility 494Using the date Command 495

Scheduling Tasks: cron 495The crond Service 495crontab Entries 495

Page 15: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

X V i i i R e d H a t : T h e C o m p l e t e R e f e r e n c e E n t e r p r i s e L i n u x & F e d o r a E d i t i o n

cron Environment Variables 496cron.d Directory 496crontab Command 497cron Editing 497Organizing Scheduled Tasks 497Running cron Directory Scripts 498cron Directory Names 499Anacron 499

System Runlevels: telinit, initab, and shutdown 499Runlevels 499initab Runlevels 501Changing Runlevels with telinit 501runlevel Command 501Shutdown 501

Managing Services 503_ chkeonfig 503

service Command 503redhat-config-services 503

Red Hat Administration Tools 504System Directories 504

Program Directories 505Configuration Directories and Files 505

Configuration Files: /etc 506/etc/sysconfig 506

System Logs: /var/log and syslogd 508redhat-logviewer 508syslogd and syslog.conf 508syslogd.conf Entries 508Priorities 510Actions and Users 510/etc/syslog.conf Example 511

Performance Analysis Tools and Processes 512ps Command 512vmstat, free, top, iostat, Xload, and sar 513Procman System Manager 513GNOME System Manager (GTop) 514KDE Process Manager (kpm) 514KDE Task Manager and Performance Monitor (KSysguard) . . . 514

Grand Unified Bootloader (GRUB) 515Backups 516

Amanda 516Backups with dump and restore 517

28 Managing Users 523User Configuration Files 523

Page 16: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

C o n t e n t s XIX

The Password Files - 524/etc/passwd 524/etc/shadow and /etc/gshadow 525Password Tools 525

Managing User Environments 526Profile Scripts 526/etc/skel 526/etc/login.defs 527/etc/login.access 527Controlling User Passwords 527

Adding and Removing Users with useradd, usermod,and userdel 529

useradd 529usermod 530userdel 530

Managing Groups 531/etc/group and /etc/gshadow .' 531User Private Groups 531Group Directories 531Managing Groups with the Red Hat User Manager 532Managing Groups Using groupadd, groupmod,

and groupdel 532Controlling Access to Directories and Files: chmod 533

Permissions 533chmod 534Ownership 534Changing a File's Owner or Group: chown and chgrp 536Setting Permissions: Permission Symbols 537Absolute Permissions: Binary Masks 538Directory Permissions 539Ownership Permissions 540Sticky Bit Permissions 541Permission Defaults: umask 541

Disk Quotas 542Quota Tools 542edquota 542quotacheck, quotaon, and quotaoff 543repquota and quota 543

Lightweight Directory Access Protocol 544LDAP Clients and Servers 544LDAP Configuration Files 545LDAP Tools 545LDAP and PAM 545LDAP and the Name Service Switch Service 546

Page 17: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

X X R e d H a t : T h e C o m p l e t e R e f e r e n c e E n t e r p r i s e L i n u x & F e d o r a E d i t i o n

Pluggable Authentication Modules 546PAM Configuration Files 546PAM Modules 547

29 Software Management 549Software Repositories 549Software Package Types 550Red Hat Package Manager (RPM) 551

RPM Tools 551RPM Packages 552Installing from the Desktop: redhat-config-packages 552Updating Software 552Command Line Installation: rpm 553

Installing Software from RPM Source Code Files: SRPMs 559Source Code RPM Directories 560Building the Source Code 560

Installing Software from Compressed Archives: .tar.gz 560Decompressing and Extracting Software in One Step 560Decompressing Software 561Selecting an Install Directory 561Extracting Software 562Compiling Software 562Command and Program Directories: PATH 565

The Concurrent Versions System: CVS 566Packaging Your Software with RPM 567

30 File System Management 569File Systems 570Filesystem Hierarchy Standard 570

Root Directory: / 570System Directories 571The /usr Directory 573The /mnt Directory 573The /home Directory 573The /var Directory 573The /proc File System 574Device Files: /dev 575Mounting File Systems 577File System Information 578

Journaling 579ext3 Journaling 580ReiserFS 580

Mounting File Systems Automatically: / etc/fstab 580Auto Mounts 581mount Options 582

Page 18: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

C o n t e n t s XXJ

Boot and Disk Check 584CD-ROM and Floppy Defaults 584Partition Labels: e21abel 584Windows Partitions 585Linux Kernel Interfaces 585noauto 585

Mounting File Systems Directly: mount and umount 586The mount Command 586The umount Command 587Mounting Floppy Disks 588Mounting CD-ROMs 589Mounting Hard Drive Partitions: Linux and Windows 590

Installing IDE CD-R/RW and DVD R/RW Devices 590SCSI Emulation 591Kernel Parameters at Boot Time 591Grub and CD Writers 591scanbus 592

Creating File Systems: mkfs, mke2fs, mkswap, parted, and fdisk .. 592fdisk 592parted 594mkfs 595mkswap 596

CD-ROM and DVD ROM Recording 596mkisofs 597cdrecord and dvdrecord 598dvd+rw Tools 599

31 RAID and LVM 601Enabling RAID and LVM in the Kernel 601Configuring RAID Devices 601

Linux Software RAID Levels 602RAID Devices and Partitions: md and fd 604Corresponding Hard Disk Partitions 604Booting from a RAID Device 604Automatic Detection: Persistent Superblocks 605RAID Tools 606Creating and Installing RAID Devices 606RAID Example 610

Logical Volume Manager 611LVM Structure 611Creating LVMs with Disk Druid 612LVM Tools 612LVM Example 614

Page 19: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

X X i ' l R e d H a t : T h e C o m p l e t e R e f e r e n c e E n t e r p r i s e L i n u x & F e d o r a E d i t i o n

32 Devices and Modules 617Device Files 617

Device Symbolic Links 618Hardware Device Installation: Kudzu 618Creating Device Files Manually 619

Device Information: /proc and /etc/sysconfig/hwconf 620Installing and Managing Terminals and Modems 621

Serial Ports 621mingetty, mgetty, and agetty 621termcap and inittab Files 622tset 622

Input Devices 622PCMCIADevices 623Installing Sound, Network, and Other Cards 624Sound Devices 625Video, TV, and DVD Devices 626Modules 626

Kernel Module Tools 626Module Files and Directories 627Managing Modules with /etc/modules.conf 628Installing New Modules for the Kernel 630

33 Kernel Administration 633Kernel Versions 633Kernel Tuning: Kernel Runtime Parameters 634Installing a New Kernel Version 635

Red Hat Kernel Packages 636CPU Kernel Packages 636Support Packages 637Installing Kernel Packages: /boot 637

Precautionary Steps for Modifying a Kernel of theSame Version 638

Boot Loader 639Boot Disk 640

Compiling the Kernel from Source Code 640Installing Kernel Sources: Kernel Archives and Patches . . . . 640Configuring the Kernel 641

Important Kernel Configuration Features 644Compiling and Installing the Kernel 646

Installing the Kernel Image Manually 647Kernel Boot Disks 648

Boot Loader Configurations 649GRUB Configurations 649

Module RAM Disks 649

Page 20: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

Contents XXJM

Part VII Network Administration

34 Domain Name System 653DNS Address Translations 653

Fully Qualified Domain Names 653IPv4 Addresses 654IPv6 Addressing 654Manual Translations: /etc/hosts 654DNS Servers 654DNS Operation .' 655DNS Clients: Resolvers 656

Local Area Network Addressing 656IPv4 Private Networks 656IPv6 Private Networks 658

BIND 658Alternative DNS Servers 658DNS Documentation 659BIND Servers and Tools 659Starting and Stopping the BIND Server 660

Domain Name Service Configuration 660DNS Zones 660DNS Server Types 661

named.conf 662zone Statement 663Configuration Statements 664

options Statement 665directory Option 666forwarders Option 666notify Option 666named.conf Example 666IPv6 named.conf Version 667Caching-Only Server 668

Resource Records 669Resource Record Types 669Start of Authority: SOA 670Name Server: NS 671Address Record: A and A6 671Mail Exchanger: MX 672Aliases: CNAME 673Pointer Record: PTR 673Host Information: HINFO, RP, MINFO, and TXT 674

Zone Files 674Zone Files for Internet Zones 674IPv6 Zone File 678

Page 21: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

X X J V R e d H a t : T h e C o m p l e t e R e f e r e n c e E n t e r p r i s e L i n u x & F e d o r a E d i t i o n

Reverse Mapping File 678Localhost Reverse Mapping 681

Subdomains and Slaves 682Subdomain Zones 682Subdomain Records 682Slave Servers 683

IP Virtual Domains 684Cache File ' 685Dynamic Update: DHCP and Journal Files 686

TSIG Signatures and Updates 686Manual Updates: nsupdate 687

DNS Security: Access Control Lists, TSIG, and DNSSEC 687Access Control Lists 687Secret Keys 688DNSSEC 689TSIG Keys 691

Split DNS: Views 692Internal and External Views 692Configuring Views 693Split View Example 693

35 DHCP Server 695Configuring DHCP Client Hosts 696Configuring the DHCP Server 696Dynamic Addresses 698Dynamic DNS Updates 700Subnetworks 702Fixed Addresses 703

36 NFSandNIS 707Network File Systems: NFS and /etc/exports 707

NFS Daemons 707Starting and Stopping NFS 708NFS Analytical Tools 708Configuring NFS with the Red Hat NFS

Configuration Tool 708NFS Configuration: /etc/exports 710NFS Security: /etc/hosts.allow and /etc/hosts.deny 713Mounting NFS File Systems: NFS Clients 714

Network Information Service: NIS 717NIS Servers 718Netgroups 721NIS Clients 721

Page 22: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

C o n t e n t s XXV

37 Samba 725Samba Documentation 725Samba Applications 726Starting Up Samba 728

Accessing Samba from Linux 728Accessing Samba from Windows 728Samba Configuration File and Tools 728

Passwords 729Samba Encrypted Passwords: smbpasswd 729

Configuring the Samba with redhat-config-samba 731Server Configuration with redhat-config-samba 731Adding Samba Users with redhat-config-samba 732Specifying Samba Shares with redhat-config-samba 732

The Samba smb.conf Configuration File 732SWAT and smb.conf 734

Activating SWAT 735Accessing SWAT 736SWAT Configuration Pages 736Creating a New Share with SWAT 737A SWAT-Generated smb.conf Example 738Global Section 739Passwords 742Homes Section 742Printer Section 742Shares 743Printers 744Variable Substitutions 745

Testing the Samba Configuration 746Domain Logons 746Accessing Samba Services with Clients 747

smbclient 747smbmount 749Sharing Windows Directories and Printers with

Samba Clients 750Windows Clients 752

38 Administering TCP/IP Networks 753TCP/IP Protocol Suite 753IPv4 and IPv6 756TCP/IP Network Addresses 756

IPv4 Network Addresses 757Class-Based IP Addressing 757Netmask 758Classless Interdomain Routing (CIDR) 759

Page 23: Red Hat: The Complete Reference Enterprise Linux & Fedora ... · New York Chicago San Francisco UlnLjo n Lisbon London Madrid Mexico City mmm* Milan NewDelhi San'uan Se°ul Sinsapore

X X V i R e d H a t : T h e C o m p l e t e R e f e r e n c e E n t e r p r i s e L i n u x & F e d o r a E d i t i o n

-Obtaining an IP Address 762Broadcast Addresses 764Gateway Addresses 764Name Server Addresses 764

IPv6 Addressing 765IPv6 Address Format 765IPv6 Interface Identifiers 766IPv6 Address Types 766

TCP/IP Configuration Files 768Identifying Hostnames: /etc/hosts 768/etc/resolv.conf 768/etc/sysconfig/network-scripts 769/etc/sysconfig/networking 769/etc/services 769/etc/protocols 769/etc/sysconfig/network 769

Domain Name Service (DNS) 769host.conf 771/etc/nsswitch.conf: Name Service Switch 772

Network Interfaces and Routes: ifconfig and route 774Network Startup Script: /etc/rc.d/init.d/network 774Interface Configuration Scripts:

/etc/sysconfig/network-scripts 774ifconfig 775Routing 777

Monitoring Your Network:ping, netstat, tcpdump, and Ethereal 779

Ethereal 779tcpdump 781netstat 781

IP Aliasing 782

A About the DVD-ROM 783

Index 785