FreeBSD Handbook

The FreeBSD Documentation Project

Revision: 44332
Copyright
Legal Notice
Last modified on 2014-03-23 by gjb.
Abstract

Welcome to FreeBSD! This handbook covers the installation and day to day use of FreeBSD 8.4-RELEASE, FreeBSD 9.2-RELEASE, and FreeBSD 10.0-RELEASE. This manual is a work in progress and is the work of many individuals. As such, some sections may become dated and require updating. If you are interested in helping out with this project, send email to the FreeBSD documentation project mailing list. The latest version of this document is always available from the FreeBSD web site (previous versions of this handbook can be obtained from http://docs.FreeBSD.org/doc/). It may also be downloaded in a variety of formats and compression options from the FreeBSD FTP server or one of the numerous mirror sites. If you would prefer to have a hard copy of the handbook, you can purchase one at the FreeBSD Mall. You may also want to search the handbook.

[ Split HTML / Single HTML ]

Table of Contents
Preface
I. Getting Started
1. Introduction
1.1. Synopsis
1.2. Welcome to FreeBSD!
1.3. About the FreeBSD Project
2. Installing FreeBSD 9.X and Later
2.1. Synopsis
2.2. Hardware Requirements
2.3. Pre-Installation Tasks
2.4. Starting the Installation
2.5. Introducing bsdinstall
2.6. Installing from the Network
2.7. Allocating Disk Space
2.8. Committing to the Installation
2.9. Post-Installation
2.10. Troubleshooting
2.11. Using the Live CD
3. Installing FreeBSD 8.X
3.1. Synopsis
3.2. Hardware Requirements
3.3. Pre-installation Tasks
3.4. Starting the Installation
3.5. Introducing sysinstall(8)
3.6. Allocating Disk Space
3.7. Choosing What to Install
3.8. Choosing the Installation Media
3.9. Committing to the Installation
3.10. Post-installation
3.11. Troubleshooting
3.12. Advanced Installation Guide
3.13. Preparing Custom Installation Media
4. UNIX Basics
4.1. Synopsis
4.2. Virtual Consoles and Terminals
4.3. Users and Basic Account Management
4.4. Permissions
4.5. Directory Structure
4.6. Disk Organization
4.7. Mounting and Unmounting File Systems
4.8. Processes and Daemons
4.9. Shells
4.10. Text Editors
4.11. Devices and Device Nodes
4.12. Manual Pages
5. Installing Applications: Packages and Ports
5.1. Synopsis
5.2. Overview of Software Installation
5.3. Finding Software
5.4. Using pkgng for Binary Package Management
5.5. Using the Ports Collection
5.6. Building Packages with Poudriere
5.7. Post-Installation Considerations
5.8. Dealing with Broken Ports
6. The X Window System
6.1. Synopsis
6.2. Terminology
6.3. Installing Xorg
6.4. Xorg Configuration
6.5. Using Fonts in Xorg
6.6. The X Display Manager
6.7. Desktop Environments
6.8. Troubleshooting
II. Common Tasks
7. Desktop Applications
7.1. Synopsis
7.2. Browsers
7.3. Productivity
7.4. Document Viewers
7.5. Finance
8. Multimedia
8.1. Synopsis
8.2. Setting Up the Sound Card
8.3. MP3 Audio
8.4. Video Playback
8.5. TV Cards
8.6. MythTV
8.7. Image Scanners
9. Configuring the FreeBSD Kernel
9.1. Synopsis
9.2. Why Build a Custom Kernel?
9.3. Finding the System Hardware
9.4. The Configuration File
9.5. Building and Installing a Custom Kernel
9.6. If Something Goes Wrong
10. Printing
10.1. Quick Start
10.2. Printer Connections
10.3. Common Page Description Languages
10.4. Direct Printing
10.5. LPD (Line Printer Daemon)
10.6. Other Printing Systems
11. Linux® Binary Compatibility
11.1. Synopsis
11.2. Configuring Linux® Binary Compatibility
11.3. Advanced Topics
III. System Administration
12. Configuration and Tuning
12.1. Synopsis
12.2. Starting Services
12.3. Configuring cron(8)
12.4. Managing Services in FreeBSD
12.5. Setting Up Network Interface Cards
12.6. Virtual Hosts
12.7. Configuring System Logging
12.8. Configuration Files
12.9. Tuning with sysctl(8)
12.10. Tuning Disks
12.11. Tuning Kernel Limits
12.12. Adding Swap Space
12.13. Power and Resource Management
13. The FreeBSD Booting Process
13.1. Synopsis
13.2. The Booting Problem
13.3. The Boot Manager and Boot Stages
13.4. Device Hints
13.5. Init: Process Control Initialization
13.6. Shutdown Sequence
14. Security
14.1. Synopsis
14.2. Introduction
14.3. One-time Passwords
14.4. TCP Wrapper
14.5. Kerberos
14.6. OpenSSL
14.7. VPN over IPsec
14.8. OpenSSH
14.9. Access Control Lists
14.10. Monitoring Third Party Security Issues
14.11. FreeBSD Security Advisories
14.12. Process Accounting
14.13. Resource Limits
15. Jails
15.1. Synopsis
15.2. Terms Related to Jails
15.3. Creating and Controlling Jails
15.4. Fine Tuning and Administration
15.5. Updating Multiple Jails
16. Mandatory Access Control
16.1. Synopsis
16.2. Key Terms
16.3. Understanding MAC Labels
16.4. Planning the Security Configuration
16.5. Available MAC Policies
16.6. User Lock Down
16.7. Nagios in a MAC Jail
16.8. Troubleshooting the MAC Framework
17. Security Event Auditing
17.1. Synopsis
17.2. Key Terms
17.3. Audit Configuration
17.4. Working with Audit Trails
18. Storage
18.1. Synopsis
18.2. Device Names
18.3. Adding Disks
18.4. Resizing and Growing Disks
18.5. USB Storage Devices
18.6. Creating and Using CD Media
18.7. Creating and Using DVD Media
18.8. Creating and Using Floppy Disks
18.9. Backup Basics
18.10. Network, Memory, and File-Backed File Systems
18.11. File System Snapshots
18.12. Disk Quotas
18.13. Encrypting Disk Partitions
18.14. Encrypting Swap
18.15. Highly Available Storage (HAST)
19. GEOM: Modular Disk Transformation Framework
19.1. Synopsis
19.2. RAID0 - Striping
19.3. RAID1 - Mirroring
19.4. Software RAID Devices
19.5. RAID3 - Byte-level Striping with Dedicated Parity
19.6. GEOM Gate Network Devices
19.7. Labeling Disk Devices
19.8. UFS Journaling Through GEOM
20. File Systems Support
20.1. Synopsis
20.2. The Z File System (ZFS)
20.3. Linux® File Systems
21. Virtualization
21.1. Synopsis
21.2. FreeBSD as a Guest OS
21.3. FreeBSD as a Host
22. Localization - i18n/L10n Usage and Setup
22.1. Synopsis
22.2. Using Localization
22.3. Finding i18n Applications
22.4. Locale Configuration for Specific Languages
23. Updating and Upgrading FreeBSD
23.1. Synopsis
23.2. FreeBSD Update
23.3. Updating the Documentation Set
23.4. Tracking a Development Branch
23.5. Synchronizing Source
23.6. Rebuilding world
23.7. Tracking for Multiple Machines
24. DTrace
24.1. Synopsis
24.2. Implementation Differences
24.3. Enabling DTrace Support
24.4. Using DTrace
IV. Network Communication
25. Serial Communications
25.1. Synopsis
25.2. Serial Terminology and Hardware
25.3. Terminals
25.4. Dial-in Service
25.5. Dial-out Service
25.6. Setting Up the Serial Console
26. PPP
26.1. Synopsis
26.2. Configuring PPP
26.3. Troubleshooting PPP Connections
26.4. Using PPP over Ethernet (PPPoE)
26.5. Using PPP over ATM (PPPoA)
27. Electronic Mail
27.1. Synopsis
27.2. Using Electronic Mail
27.3. Sendmail Configuration
27.4. Changing the Mail Transfer Agent
27.5. Troubleshooting
27.6. Advanced Topics
27.7. Setting Up to Send Only
27.8. Using Mail with a Dialup Connection
27.9. SMTP Authentication
27.10. Mail User Agents
27.11. Using fetchmail
27.12. Using procmail
28. Network Servers
28.1. Synopsis
28.2. The inetd Super-Server
28.3. Network File System (NFS)
28.4. Network Information System (NIS)
28.5. Lightweight Directory Access Protocol (LDAP)
28.6. Dynamic Host Configuration Protocol (DHCP)
28.7. Domain Name System (DNS)
28.8. Apache HTTP Server
28.9. File Transfer Protocol (FTP)
28.10. File and Print Services for Microsoft® Windows® Clients (Samba)
28.11. Clock Synchronization with NTP
28.12. iSCSI Initiator and Target Configuration
29. Firewalls
29.1. Synopsis
29.2. Firewall Concepts
29.3. PF
29.4. IPFW
29.5. IPFILTER (IPF)
30. Advanced Networking
30.1. Synopsis
30.2. Gateways and Routes
30.3. Wireless Networking
30.4. USB Tethering
30.5. Bluetooth
30.6. Bridging
30.7. Link Aggregation and Failover
30.8. Diskless Operation with PXE
30.9. IPv6
30.10. Common Address Redundancy Protocol (CARP)
V. Appendices
A. Obtaining FreeBSD
A.1. CD and DVD Sets
A.2. FTP Sites
A.3. Using CTM
A.4. Using Subversion
A.5. Using rsync
B. Bibliography
B.1. Books Specific to FreeBSD
B.2. Users' Guides
B.3. Administrators' Guides
B.4. Programmers' Guides
B.5. Operating System Internals
B.6. Security Reference
B.7. Hardware Reference
B.8. UNIX® History
B.9. Periodicals, Journals, and Magazines
C. Resources on the Internet
C.1. Mailing Lists
C.2. Usenet Newsgroups
C.3. World Wide Web Servers
D. OpenPGP Keys
D.1. Officers
FreeBSD Glossary
Index
List of Figures
2.1. FreeBSD Boot Loader Menu
2.2. Typical Device Probe Results
2.3. Selecting Installation Media Mode
2.4. Keymap Selection
2.5. Selecting Keyboard Menu
2.6. Enhanced Keymap Menu
2.7. Setting the Hostname
2.8. Selecting Components to Install
2.9. Installing from the Network
2.10. Choosing a Mirror
2.11. Selecting Guided, Manual or Shell Partitioning
2.12. Selecting Guided, Manual, Shell or ZFS Partitioning
2.13. Selecting from Multiple Disks
2.14. Selecting Entire Disk or Partition
2.15. Review Created Partitions
2.16. Manually Create Partitions
2.17. Manually Create Partitions
2.18. Manually Create Partitions
2.19. ZFS Partitioning Menu
2.20. ZFS Pool Type
2.21. Disk Selection
2.22. Invalid Selection
2.23. Analysing a Disk
2.24. Disk Encryption Password
2.25. Last Chance
2.26. Final Confirmation
2.27. Fetching Distribution Files
2.28. Verifying Distribution Files
2.29. Extracting Distribution Files
2.30. Setting the root Password
2.31. Choose a Network Interface
2.32. Scanning for Wireless Access Points
2.33. Choosing a Wireless Network
2.34. WPA2 Setup
2.35. Choose IPv4 Networking
2.36. Choose IPv4 DHCP Configuration
2.37. IPv4 Static Configuration
2.38. Choose IPv6 Networking
2.39. Choose IPv6 SLAAC Configuration
2.40. IPv6 Static Configuration
2.41. DNS Configuration
2.42. Select Local or UTC Clock
2.43. Select a Region
2.44. Select a Country
2.45. Select a Time Zone
2.46. Confirm Time Zone
2.47. Selecting Additional Services to Enable
2.48. Enabling Crash Dumps
2.49. Add User Accounts
2.50. Enter User Information
2.51. Exit User and Group Management
2.52. Final Configuration
2.53. Manual Configuration
2.54. Complete the Installation
3.1. FreeBSD Boot Loader Menu
3.2. Typical Device Probe Results
3.3. Selecting Country Menu
3.4. Selecting Keyboard Menu
3.5. Selecting Usage from Sysinstall Main Menu
3.6. Selecting Documentation Menu
3.7. Sysinstall Documentation Menu
3.8. Sysinstall Main Menu
3.9. Sysinstall Keymap Menu
3.10. Sysinstall Main Menu
3.11. Sysinstall Options
3.12. Begin Standard Installation
3.13. Select Drive for FDisk
3.14. Typical Default FDisk Partitions
3.15. Fdisk Partition Using Entire Disk
3.16. Sysinstall Boot Manager Menu
3.17. Exit Select Drive
3.18. Sysinstall Disklabel Editor
3.19. Sysinstall Disklabel Editor with Auto Defaults
3.20. Free Space for Root Partition
3.21. Edit Root Partition Size
3.22. Choose the Root Partition Type
3.23. Choose the Root Mount Point
3.24. Sysinstall Disklabel Editor
3.25. Choose Distributions
3.26. Confirm Distributions
3.27. Choose Installation Media
3.28. Selecting an Ethernet Device
3.29. Set Network Configuration for ed0
3.30. Editing inetd.conf
3.31. Default Anonymous FTP Configuration
3.32. Edit the FTP Welcome Message
3.33. Editing exports
3.34. System Console Configuration Options
3.35. Screen Saver Options
3.36. Screen Saver Timeout
3.37. System Console Configuration Exit
3.38. Select the Region
3.39. Select the Country
3.40. Select the Time Zone
3.41. Select Mouse Protocol Type
3.42. Set Mouse Protocol
3.43. Configure Mouse Port
3.44. Setting the Mouse Port
3.45. Enable the Mouse Daemon
3.46. Test the Mouse Daemon
3.47. Select Package Category
3.48. Select Packages
3.49. Install Packages
3.50. Confirm Package Installation
3.51. Select User
3.52. Add User Information
3.53. Exit User and Group Management
3.54. Exit Install
3.55. Network Configuration Upper-level
3.56. Select a Default MTA
3.57. Ntpdate Configuration
3.58. Network Configuration Lower-level
30.1. PXE Booting Process with NFS Root Mount
List of Tables
2.1. Partitioning Schemes
3.1. Sample Device Inventory
3.2. Partition Layout for First Disk
3.3. Partition Layout for Subsequent Disks
3.4. FreeBSD ISO Image Names and Meanings
4.1. Utilities for Managing User Accounts
4.2. UNIX® Permissions
4.3. Disk Device Codes
4.4. Common Environment Variables
8.1. Common Error Messages
10.1. Output PDLs
17.1. Default Audit Event Classes
17.2. Prefixes for Audit Event Classes
18.1. Physical Disk Naming Conventions
22.1. Common Language and Country Codes
22.2. Defined Terminal Types for Character Sets
22.3. Available Console From Ports Collection
22.4. Available Input Methods
25.1. DB-25 to DB-25 Null-Modem Cable
25.2. DB-9 to DB-9 Null-Modem Cable
25.3. DB-9 to DB-25 Null-Modem Cable
25.4. Signal Names
25.5. Case 1: Set the Flags to 0x10 for sio0
25.6. Case 2: Set the Flags to 0x30 for sio0
28.1. NIS Terminology
28.2. Additional Users
28.3. Additional Systems
28.4. DNS Terminology
29.1. Useful pfctl Options
30.1. Commonly Seen Routing Table Flags
30.2. Station Capability Codes
30.3. Reserved IPv6 Addresses
List of Examples
2.1. Using an Existing Partition
2.2. Shrinking an Existing Partition
2.3. Creating Traditional Split Filesystem Partitions
3.1. Using an Existing Partition Unchanged
3.2. Shrinking an Existing Partition
4.1. Install a Program As the Superuser
4.2. Adding a User on FreeBSD
4.3. rmuser Interactive Account Removal
4.4. Using chpass as Superuser
4.5. Using chpass as Regular User
4.6. Changing Your Password
4.7. Changing Another User's Password as the Superuser
4.8. Adding a Group Using pw(8)
4.9. Adding User Accounts to a New Group Using pw(8)
4.10. Adding a New Member to a Group Using pw(8)
4.11. Using id(1) to Determine Group Membership
4.12. Sample Disk, Slice, and Partition Names
4.13. Conceptual Model of a Disk
12.1. Sample Log Server Configuration
12.2. Creating a Swapfile on FreeBSD
13.1. boot0 Screenshot
13.2. boot2 Screenshot
13.3. An Insecure Console in /etc/ttys
14.1. Create a Secure Tunnel for SMTP
14.2. Secure Access of a POP3 Server
14.3. Bypassing a Firewall
18.1. Using dump over ssh
18.2. Using dump over ssh with RSH Set
18.3. Backing Up the Current Directory With tar
18.4. Restoring Up the Current Directory With tar
18.5. Usingls and cpio to Make a Recursive Backup of the Current Directory
18.6. Backing Up the Current Directory With pax
18.7. Using mdconfig to Mount an Existing File System Image
18.8. Creating a New File-Backed Disk with mdconfig
18.9. Configure and Mount a File-Backed Disk with mdmfs
18.10. Creating a New Memory-Based Disk with mdconfig
18.11. Creating a New Memory-Based Disk with mdmfs
19.1. Labeling Partitions on the Boot Disk
25.1. Adding Terminal Entries to /etc/ttys
27.1. Configuring the Sendmail Access Database
27.2. Mail Aliases
27.3. Example Virtual Domain Mail Map
28.1. Reloading the inetd Configuration File
28.2. Mounting an Export with amd
28.3. Sample /etc/ntp.conf
30.1. LACP Aggregation with a Cisco® Switch
30.2. Failover Mode
30.3. Failover Mode Between Ethernet and Wireless Interfaces

All FreeBSD documents are available for download at http://ftp.FreeBSD.org/pub/FreeBSD/doc/

Questions that are not answered by the documentation may be sent to <freebsd-questions@FreeBSD.org>.
Send questions about this document to <freebsd-doc@FreeBSD.org>.