This book is dedicated to Alex.
9233fm.qxd 11/13/07 2:51 PM Page iii
9233fm.qxd 11/13/07 2:51 PM Page iv
Contents at a Glance
About the Author
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
About the Technical Reviewer
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Introduction
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
■
CHAPTER 1 Installing Ubuntu Server
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
■
CHAPTER 2 Getting the Most Out of the Command Line
. . . . . . . . . . . . . . . . . . . . . 25
■
CHAPTER 3 Performing Essential System Administration Tasks
. . . . . . . . . . . . . 47
■
CHAPTER 4 Performing File System Management Tasks
. . . . . . . . . . . . . . . . . . . . 73
■
CHAPTER 5 Configuring Your Server for Security
. . . . . . . . . . . . . . . . . . . . . . . . . . . 107
■
CHAPTER 6 Setting the System to Your Hand
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
■
CHAPTER 7 Running It Anyway You Like
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
■
CHAPTER 8 Making Connection
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
■
CHAPTER 9 Configuring Network Infrastructure Services
. . . . . . . . . . . . . . . . . . 255
■
CHAPTER 10 Using Ubuntu Server As a File and Print Server
. . . . . . . . . . . . . . . . 287
■
CHAPTER 11 Setting Up Web Services
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
■
CHAPTER 12 Multiplying Your Server
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
■
INDEX
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
v
9233fm.qxd 11/13/07 2:51 PM Page v
9233fm.qxd 11/13/07 2:51 PM Page vi
Contents
About the Author
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
About the Technical Reviewer
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Introduction
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
■
CHAPTER 1
Installing Ubuntu Server
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Preparing for the Installation
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Starting the Ubuntu Server Installation Process
. . . . . . . . . . . . . . . . . . . . . . . 2
Configuring the Server’s Hard Drive
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Completing the Installation
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
■
CHAPTER 2
Getting the Most Out of the Command Line
. . . . . . . . . . . . . . . 25
Working As root?
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Working with the Shell
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Using Bash to Best Effect
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Managing Bash with Key Sequences
. . . . . . . . . . . . . . . . . . . . . . . . . . 29
Performing Basic File System Management Tasks
. . . . . . . . . . . . . . . . . . . 30
Working with Directories
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Working with Files
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Viewing the Content of Text Files
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Finding Files That Contain Specific Text
. . . . . . . . . . . . . . . . . . . . . . . . 35
Creating Empty Files
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Piping and Redirection
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Piping
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Redirection
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Finding Files
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Working with an Editor
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Vi Modes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Saving and Quitting
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Cut, Copy, and Paste
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Deleting Text
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
vii
9233fm.qxd 11/13/07 2:51 PM Page vii
Getting Help
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Using man to Get Help
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Using the help Option
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Getting Information on Installed Packages
. . . . . . . . . . . . . . . . . . . . . 46
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
■
CHAPTER 3
Performing Essential System Administration Tasks
. . . . . . 47
Software Management
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Software Repositories and Package Databases
. . . . . . . . . . . . . . . . . 48
Package Management Utilities
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Installing Software from Tarballs
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Configuring a Graphical User Interface
. . . . . . . . . . . . . . . . . . . . . . . . 58
Creating Backups
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Making File Backups with tar
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Making Device Backups Using dd
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Configuring Logging
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Configuring syslog
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Logging in Other Ways
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Rotating Log Files
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
■
CHAPTER 4
Performing File System Management Tasks
. . . . . . . . . . . . . . 73
Mounting Disks
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Using the mount Command
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Unmounting Devices
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Automating Mounts with /etc/fstab
. . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Checking File System Integrity
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Working with Links
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Why Use Links?
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Working with Symbolic Links
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Working with Hard Links
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Configuring Storage
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Comparing File Systems
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Creating File Systems
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Working with Logical Volumes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Doing Magic on Your File Systems with dd
. . . . . . . . . . . . . . . . . . . . . . . . . 102
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
■
CONTENTSviii
9233fm.qxd 11/13/07 2:51 PM Page viii
■
CHAPTER 5
Configuring Your Server for Security
. . . . . . . . . . . . . . . . . . . . . 107
Setting Up User Accounts
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Commands for User Management
. . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Managing Passwords
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Modifying and Deleting User Accounts
. . . . . . . . . . . . . . . . . . . . . . . 112
Behind the Commands: Configuration Files
. . . . . . . . . . . . . . . . . . . 112
Creating Groups
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Commands for Group Management
. . . . . . . . . . . . . . . . . . . . . . . . . . 117
Behind the Commands: /etc/group
. . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Managing the User’s Shell Environment
. . . . . . . . . . . . . . . . . . . . . . 118
Configuring Permissions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Read, Write, and Execute: The Three Basic Linux Permissions
. . . 119
Permissions and the Concept of Ownership
. . . . . . . . . . . . . . . . . . . 119
Working with Advanced Linux Permissions
. . . . . . . . . . . . . . . . . . . . . . . . . 122
Setting Permissions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Using umask to Set Default Permissions
. . . . . . . . . . . . . . . . . . . . . . 125
Working with Access Control Lists
. . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Preparing the File System for ACLs
. . . . . . . . . . . . . . . . . . . . . . . . . . 127
ACL Limitations
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Applying File Attributes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Apply Quota to Allow a Maximum Amount of Files
. . . . . . . . . . . . . . . . . . 131
Installing the Quota Software
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Preparing the File System for Quota
. . . . . . . . . . . . . . . . . . . . . . . . . . 132
Initializing Quota
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Setting Quota for Users and Groups
. . . . . . . . . . . . . . . . . . . . . . . . . . 133
Understanding Pluggable Authentication Modules
. . . . . . . . . . . . . . . . . . 134
Creating a Default Policy for Security
. . . . . . . . . . . . . . . . . . . . . . . . . 136
Discovering PAM Modules
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Configuring Administrator Tasks with sudo
. . . . . . . . . . . . . . . . . . . . . . . . . 140
An Introduction to Setting Up the Netfilter Firewall with iptables
. . . . . . 141
Netfilter Building Blocks
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Using iptables to Create a Firewall
. . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
■
CHAPTER 6
Setting the System to Your Hand
. . . . . . . . . . . . . . . . . . . . . . . . . . 151
Process Monitoring and Management
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Different Kinds of Processes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Foreground and Background
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Managing Processes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Other Tools to Monitor System Activity
. . . . . . . . . . . . . . . . . . . . . . . . 157
Setting Process Priority
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
■
CONTENTS ix
9233fm.qxd 11/13/07 2:51 PM Page ix
Executing Processes Automatically
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Configuring cron
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Executing Once with at
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Tuning the Boot Procedure
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Managing the GRUB Boot Loader
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
The GRUB Configuration File
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Installing GRUB
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Working with the GRUB Boot Menu
. . . . . . . . . . . . . . . . . . . . . . . . . . 168
Upstart
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Runlevels
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Making Service Management Easier
. . . . . . . . . . . . . . . . . . . . . . . . . 173
Managing Hardware
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Kernel Management
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Installing Your Own Custom Kernel
. . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Hardware Management with udev
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
■
CHAPTER 7
Running It Anyway You Like
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Before You Even Start
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
To Script or Not to Script?
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
What Shell?
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Basic Elements of a Shell Script
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Making It Executable
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Making a Script Interactive
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Working with Arguments
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Working with Variables
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Command Substitution
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Changing Variables
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Substitution Operators
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Pattern-Matching Operators
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Performing Calculations in Scripts
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Using Flow Control
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Using if then else
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Case
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Using while
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Using until
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Using for
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Using a Stream Editor
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Working with Functions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
A Complex Scripting Example
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
■
CONTENTSx
9233fm.qxd 11/13/07 2:51 PM Page x
■
CHAPTER 8
Making Connection
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Configuring the Network Card
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Using ifup, ifdown, and Related Tools
. . . . . . . . . . . . . . . . . . . . . . . . . 219
Using ifconfig
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Using the ip Tool
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Managing IPv6
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Managing Routes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Configuring the DNS Resolver
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Configuring Network Card Properties with the ethtool
Command
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Troubleshooting Network Connections
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Testing Connectivity
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Testing Routability
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Testing Availability of Services
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Monitoring the Network Interface
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Monitoring Network Traffic
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Connecting Remotely with SSH
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Working with Public/Private Key Pairs
. . . . . . . . . . . . . . . . . . . . . . . . 244
Working with Secure Shell
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Configuring SSH
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Using Key-Based Authentication
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
A Short Introduction to Cryptography
. . . . . . . . . . . . . . . . . . . . . . . . . 248
Using Public/Private Key–Based Authentication in an SSH
Environment
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Setting Up SSH for Key-Based Authentication
. . . . . . . . . . . . . . . . . 249
Caching Keys with ssh-agent
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Tunneling Traffic with SSH
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
X Forwarding
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Generic TCP Port Forwarding
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
■
CHAPTER 9
Configuring Network Infrastructure Services
. . . . . . . . . . . . 255
Configuring DNS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Methods of Name Resolution
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Structure of the DNS Hierarchy
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Introducing Forward and Reverse DNS
. . . . . . . . . . . . . . . . . . . . . . . 260
Configuring DNS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Configuring Reversed Lookup
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Testing Your Name Server
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
■
CONTENTS xi
9233fm.qxd 11/13/07 2:51 PM Page xi
Configuring DHCP
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Understanding the DHCP Protocol
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Creating the DHCP Server Configuration
. . . . . . . . . . . . . . . . . . . . . . 269
The DHCP Process
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
The /etc/dhcpd.conf Configuration File
. . . . . . . . . . . . . . . . . . . . . . . 270
Advanced DHCP Configuration Options
. . . . . . . . . . . . . . . . . . . . . . . 273
The DHCP Relay Agent
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Configuring NTP
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
How NTP Works
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Configuring a Stand-Alone NTP Time Server
. . . . . . . . . . . . . . . . . . 277
Pulling or Pushing the Time
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Configuring an NTP Client
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Checking NTP Synchronization Status
. . . . . . . . . . . . . . . . . . . . . . . . 279
Customizing Your NTP Server
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Applying NTP Security
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Starting Services with xinetd
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Setting up xinetd by Hand
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Tuning Access to Services with TCP Wrapper
. . . . . . . . . . . . . . . . . . 284
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
■
CHAPTER 10
Using Ubuntu Server As a File and Print Server
. . . . . . . . . 287
Setting Up a CUPS Print Server
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Adding Printers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Sharing Printers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Managing Printers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Accessing CUPS Printers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Sharing Files with NFS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Using the NFS Server
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Understanding How the NFS Works
. . . . . . . . . . . . . . . . . . . . . . . . . . 294
Configuring an NFS Server
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
Configuring an NFS Client
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
Monitoring the NFS Server
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Sharing Files with Samba
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Samba Server Possibilities and Impossibilities
. . . . . . . . . . . . . . . . . 300
Configuring the Samba Server
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Integrating CUPS with Samba
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
Setting Up Samba As a Domain Controller
. . . . . . . . . . . . . . . . . . . . 307
Client Access to the Samba Server
. . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
■
CONTENTSxii
9233fm.qxd 11/13/07 2:51 PM Page xii
Không có nhận xét nào:
Đăng nhận xét