Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Cover
Half Title
About the Author
Title
Copyright
Dedication
At a Glance
Contents
Acknowledgments
Introduction
Part I: Introduction, Installation, and Software Management
1: Technical Summary of Linux Distributions
Linux: The Operating System
What Is Open Source Software and GNU All About?
What Is the GNU Public License?
Upstream and Downstream
The Advantages of Open Source Software
Understanding the Differences Between Windows and Linux
Single Users vs. Multiple Users vs. Network Users
The Monolithic Kernel and the Micro-Kernel
Separation of the GUI and the Kernel
The Network Neighborhood
The Registry vs. Text Files
Domains and Active Directory
Summary
2: Installing Linux in a Server Configuration
Hardware and Environmental Considerations
Server Design
Uptime
Methods of Installation
Installing Fedora
Project Prerequisites
The Installation
Initial System Configuration
Installing Ubuntu Server
Summary
3: Managing Software
The Red Hat Package Manager
Managing Software Using RPM
GUI RPM Package Managers
The Debian Package Management System
APT
Software Management in Ubuntu
Querying for Information
Installing Software in Ubuntu
Removing Software in Ubuntu
Compile and Install GNU Software
Getting and Unpacking the Package
Looking for Documentation
Configuring the Package
Compiling the Package
Installing the Package
Testing the Software
Cleanup
Common Problems When Building from Source Code
Problems with Libraries
Missing Configure Script
Broken Source Code
Summary
Part II: Single-Host Administration
4: Managing Users and Groups
What Exactly Constitutes a User?
Where User Information Is Kept
The /etc/passwd File
The /etc/shadow File
The /etc/group File
User Management Tools
Command-Line User Management
GUI User Managers
Users and Access Permissions
Understanding SetUID and SetGID Programs
Pluggable Authentication Modules
How PAM Works
PAM’s Files and Their Locations
Configuring PAM
The “Other” File
D’oh! I Can’t Log In!
Debugging PAM
A Grand Tour
Creating Users with useradd
Creating Groups with groupadd
Modifying User Attributes with usermod
Modifying Group Attributes with groupmod
Deleting Users and Groups with userdel and groupdel
Summary
5: The Command Line
An Introduction to BASH
Job Control
Environment Variables
Pipes
Redirection
Command-Line Shortcuts
Filename Expansion
Environment Variables as Parameters
Multiple Commands
Backticks
Documentation Tools
The man Command
The texinfo System
Files, File Types, File Ownership, and File Permissions
Normal Files
Directories
Hard Links
Symbolic Links
Block Devices
Character Devices
Named Pipes
Listing Files: ls
Change Ownership: chown
Change Group: chgrp
Change Mode: chmod
File Management and Manipulation
Copy Files: cp
Move Files: mv
Link Files: ln
Find a File: find
File Compression: gzip
bzip2
Create a Directory: mkdir
Remove a Directory: rmdir
Show Present Working Directory: pwd
Tape Archive: tar
Concatenate Files: cat
Display a File One Screen at a Time: more
Disk Utilization: du
Show the Directory Location of a File: which
Locate a Command: whereis
Disk Free: df
Synchronize Disks: sync
Moving a User and Its Home Directory
List Processes: ps
Show an Interactive List of Processes: top
Send a Signal to a Process: kill
Miscellaneous Tools
Show System Name: uname
Who Is Logged In: who
A Variation on who: w
Switch User: su
Editors
vi
emacs
joe
pico
Summary
6: Booting and Shutting Down
Boot Loaders
GRUB Legacy
GRUB 2
LILO
Bootstrapping
The init Process
rc Scripts
Writing Your Own rc Script
Enabling and Disabling Services
Disabling a Service
Odds and Ends of Booting and Shutting Down
fsck!
Booting into Single-User (“Recovery”) Mode
Summary
7: File Systems
The Makeup of File Systems
i-Nodes
Block
Superblocks
ext3
ext4
Btrfs
Which File System Should You Use?
Managing File Systems
Mounting and Unmounting Local Disks
Using fsck
Adding a New Disk
Overview of Partitions
Traditional Disk and Partition Naming Conventions
Volume Management
Creating Partitions and Logical Volumes
Creating File Systems
Summary
8: Core System Services
The init Daemon
upstart: Die init. Die Now!
The /etc/inittab File
systemd
xinetd and inetd
The /etc/xinetd.conf File
Examples: A Simple Service Entry and Enabling/Disabling a Service
The Logging Daemon
Invoking rsyslogd
Configuring the Logging Daemon
Log Message Classifications
Format of /etc/rsyslog.conf
The cron Program
The crontab File
Editing the crontab File
Summary
9: The Linux Kernel
What Exactly Is a Kernel?
Finding the Kernel Source Code
Getting the Correct Kernel Version
Unpacking the Kernel Source Code
Building the Kernel
Preparing to Configure the Kernel
Kernel Configuration
Compiling the Kernel
Installing the Kernel
Booting the Kernel
The Author Lied—It Didn’t Work!
Patching the Kernel
Downloading and Applying Patches
Summary
10: Knobs and Dials: Virtual File Systems
What’s Inside the /proc Directory?
Tweaking Files Inside of /proc
Some Useful /proc Entries
Enumerated /proc Entries
Common proc Settings and Reports
SYN Flood Protection
Issues on High-Volume Servers
Debugging Hardware Conflicts
SysFS
cgroupfs
Summary
Part III: Networking and Security
11: TCP/IP for System Administrators
The Layers
Packets
TCP/IP Model and the OSI Model
Headers
Ethernet
IP (IPv4)
TCP
UDP
A Complete TCP Connection
Opening a Connection
Transferring Data
Closing the Connection
How ARP Works
The ARP Header: ARP Works with Other Protocols, Too!
Bringing IP Networks Together
Hosts and Networks
Subnetting
Netmasks
Static Routing
Dynamic Routing with RIP
Digging into tcpdump
A Few General Notes
Graphing Odds and Ends
IPv6
IPv6 Address Format
IPv6 Address Types
IPv6 Backward-Compatibility
Summary
12: Network Configuration
Modules and Network Interfaces
Network Device Configuration Utilities (ip and ifconfig)
Simple Usage
IP Aliasing
Setting up NICs at Boot Time
Managing Routes
Simple Usage
Displaying Routes
A Simple Linux Router
Routing with Static Routes
How Linux Chooses an IP Address
Summary
13: Linux Firewall (Netfilter)
How Netfilter Works
A NAT Primer
NAT-Friendly Protocols
Chains
Installing Netfilter
Enabling Netfilter in the Kernel
Configuring Netfilter
Saving Your Netfilter Configuration
The iptables Command
Cookbook Solutions
Rusty’s Three-Line NAT
Configuring a Simple Firewall
Summary
14: Local Security
Common Sources of Risk
SetUID Programs
Unnecessary Processes
Picking the Right Runlevel
Nonhuman User Accounts
Limited Resources
Mitigating Risk
Using chroot
SELinux
AppArmor
Monitoring Your System
Logging
Using ps and netstat
Using df
Automated Monitoring
Mailing Lists
Summary
15: Network Security
TCP/IP and Network Security
The Importance of Port Numbers
Tracking Services
Using the netstat Command
Security Implications of netstat’s Output
Binding to an Interface
Shutting Down Services
Shutting Down xinetd and inetd Services
Shutting Down Non-xinetd Services
Shutting Down Services in a Distribution-Independent Way
Monitoring Your System
Making the Best Use of syslog
Monitoring Bandwidth with MRTG
Handling Attacks
Trust Nothing (and No One)
Change Your Passwords
Pull the Plug
Network Security Tools
nmap
Snort
Nessus
Wireshark/tcpdump
Summary
Part IV: Internet Services
16: DNS
The Hosts File
How DNS Works
Domain and Host Naming Conventions
Subdomains
The in-addr.arpa Domain
Types of Servers
Installing a DNS Server
Understanding the BIND Configuration File
The Specifics
Configuring a DNS Server
Defining a Primary Zone in the named.conf File
Defining a Secondary Zone in the named.conf File
Defining a Caching Zone in the named.conf File
DNS Records Types
SOA: Start of Authority
NS: Name Server
A: Address Record
PTR: Pointer Record
MX: Mail Exchanger
CNAME: Canonical Name
RP and TXT: The Documentation Entries
Setting up BIND Database Files
Breaking out the Individual Steps
The DNS Toolbox
host
dig
nslookup
whois
nsupdate
The rndc Tool
Configuring DNS Clients
The Resolver
Configuring the Client
Summary
17: FTP
The Mechanics of FTP
Client/Server Interactions
Obtaining and Installing vsftpd
Configuring vsftpd
Starting and Testing the FTP Server
Customizing the FTP Server
Setting up an Anonymous-Only FTP Server
Setting up an FTP Server with Virtual Users
Summary
18: Apache Web Server
Understanding HTTP
Headers
Ports
Process Ownership and Security
Installing the Apache HTTP Server
Apache Modules
Starting up and Shutting Down Apache
Starting Apache at Boot Time
Testing Your Installation
Configuring Apache
Creating a Simple Root-Level Page
Apache Configuration Files
Common Configuration Options
Troubleshooting Apache
Summary
19: SMTP
Understanding SMTP
Rudimentary SMTP Details
Security Implications
Installing the Postfix Server
Installing Postfix via RPM in Fedora
Installing Postfix via APT in Ubuntu
Configuring the Postfix Server
The main.cf File
Checking Your Configuration
Running the Server
Checking the Mail Queue
Flushing the Mail Queue
The newaliases Command
Making Sure Everything Works
Summary
20: POP and IMAP
POP and IMAP Basics
Installing the UW-IMAP and POP3 Server
Running UW-IMAP
Other Issues with Mail Services
SSL Security
Testing IMAP and POP3 Connectivity over SSL
Availability
Log Files
Summary
21: The Secure Shell (SSH)
Understanding Public Key Cryptography
Key Characteristics
Cryptography References
Understanding SSH Versions
OpenSSH and OpenBSD
Alternative Vendors for SSH Clients
Installing OpenSSH via RPM in Fedora
Installing OpenSSH via APT in Ubuntu
Server Start-up and Shutdown
SSHD Configuration File
Using OpenSSH
Secure Shell (ssh) Client Program
Secure Copy (scp) Program
Secure FTP (sftp) Program
Files Used by the OpenSSH Client
Summary
Part V: Intranet Services
22: Network File System (NFS)
The Mechanics of NFS
Versions of NFS
Security Considerations for NFS
Mount and Access a Partition
Enabling NFS in Fedora
Enabling NFS in Ubuntu
The Components of NFS
Kernel Support for NFS
Configuring an NFS Server
The /etc/exports Configuration File
Configuring NFS Clients
The mount Command
Soft vs. Hard Mounts
Cross-Mounting Disks
The Importance of the intr Option
Performance Tuning
Troubleshooting Client-Side NFS Issues
Stale File Handles
Permission Denied
Sample NFS Client and NFS Server Configuration
Common Uses for NFS
Summary
23: Samba
The Mechanics of SMB
Usernames and Passwords
Encrypted Passwords
Samba Daemons
Installing Samba via RPM
Installing Samba via APT
Samba Administration
Starting and Stopping Samba
Using SWAT
Setting up SWAT
The SWAT Menus
Globals
Shares
Printers
Status
View
Password
Creating a Share
Using smbclient
Mounting Remote Samba Shares
Samba Users
Creating Samba Users
Allowing Null Passwords
Changing Passwords with smbpasswd
Using Samba to Authenticate Against a Windows Server
winbindd Daemon
Troubleshooting Samba
Summary
24: Distributed File Systems
DFS Overview
DFS Implementations
GlusterFS
Summary
25: Network Information Service
Inside NIS
The NIS Servers
Domains
Configuring the Master NIS Server
Establishing the Domain Name
Starting NIS
Editing the Makefile
Using ypinit
Configuring an NIS Client
Editing the /etc/yp.conf File
Enabling and Starting ypbind
Editing the /etc/nsswitch.conf File
NIS at Work
Testing Your NIS Client Configuration
Configuring a Secondary NIS Server
Setting the Domain Name
Setting up the NIS Master to Push to Slaves
Running ypinit
NIS Tools
Using NIS in Configuration Files
Implementing NIS in a Real Network
A Small Network
A Segmented Network
Networks Bigger than Buildings
Summary
26: LDAP
LDAP Basics
LDAP Directory
Client/Server Model
Uses of LDAP
LDAP Terminology
OpenLDAP
Server-Side Daemons
OpenLDAP Utilities
Installing OpenLDAP
Configuring OpenLDAP
Configuring slapd
Starting and Stopping slapd
Configuring OpenLDAP Clients
Creating Directory Entries
Searching, Querying, and Modifying the Directory
Using OpenLDAP for User Authentication
Configuring the Server
Configuring the Client
Summary
27: Printing
Printing Terminologies
The CUPS System
Running CUPS
Installing CUPS
Configuring CUPS
Adding Printers
Local Printers and Remote Printers
Routine CUPS Administration
Setting the Default Printer
Enabling, Disabling, and Deleting Printers
Accepting and Rejecting Print Jobs
Managing Printing Privileges
Managing Printers via the Web Interface
Using Client-Side Printing Tools
lpr
lpq
lprm
Summary
28: DHCP
The Mechanics of DHCP
The DHCP Server
Installing DHCP Software via RPM
Installing DHCP Software via APT in Ubuntu
Configuring the DHCP Server
A Sample dhcpd.conf File
The DHCP Client Daemon
Configuring the DHCP Client
Summary
29: Virtualization
Why Virtualize?
Virtualization Concepts
Virtualization Implementations
Hyper-V
KVM
QEMU
UML
VirtualBox
VMware
Xen
Kernel-Based Virtual Machines
KVM Example
Managing KVM Virtual Machines
Setting up KVM in Ubuntu/Debian
Summary
30: Backups
Evaluating Your Backup Needs
Amount of Data
Backup Hardware and Backup Medium
Network Throughput
Speed and Ease of Data Recovery
Data Deduplication
Tape Management
Command-Line Backup Tools
dump and restore
Miscellaneous Backup Solutions
Summary
Part VI: Appendixes
A: Creating a Linux Installer on Flash/USB Devices
Creating a Linux Installer on Flash/USB Devices (via Linux OS)
Creating a Linux Installer on Flash/USB Devices (via Microsoft Windows OS)
Fedora Installer Using Live USB Creator on Windows OS
Ubuntu Installer Using UNetbootin on Windows OS
B: openSUSE Installation
Index
← Prev
Back
Next →
← Prev
Back
Next →