FreeBSD Handbook

The FreeBSD Documentation Project

Revision: 52785
Copyright
Legal Notice
Last modified on 2019-01-28 12:37:45 by dbaio.
Abstract

Welcome to FreeBSD! This handbook covers the installation and day to day use of FreeBSD 12.0-RELEASE and FreeBSD 11.2-RELEASE. This book is the result of ongoing work by many individuals. Some sections might be outdated. Those interested in helping to update and expand this document should send email to the FreeBSD documentation project mailing list.

The latest version of this book is available from the FreeBSD web site. Previous versions can be obtained from https://docs.FreeBSD.org/doc/. The book can be downloaded in a variety of formats and compression options from the FreeBSD FTP server or one of the numerous mirror sites. Printed copies can be purchased at the FreeBSD Mall. Searches can be performed on the handbook and other documents on the search page.

[ 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
2.1. Synopsis
2.2. Minimum Hardware Requirements
2.3. Pre-Installation Tasks
2.4. Starting the Installation
2.5. Using bsdinstall
2.6. Allocating Disk Space
2.7. Committing to the Installation
2.8. Post-Installation
2.9. Troubleshooting
2.10. Using the Live CD
3. FreeBSD Basics
3.1. Synopsis
3.2. Virtual Consoles and Terminals
3.3. Users and Basic Account Management
3.4. Permissions
3.5. Directory Structure
3.6. Disk Organization
3.7. Mounting and Unmounting File Systems
3.8. Processes and Daemons
3.9. Shells
3.10. Text Editors
3.11. Devices and Device Nodes
3.12. Manual Pages
4. Installing Applications: Packages and Ports
4.1. Synopsis
4.2. Overview of Software Installation
4.3. Finding Software
4.4. Using pkg for Binary Package Management
4.5. Using the Ports Collection
4.6. Building Packages with Poudriere
4.7. Post-Installation Considerations
4.8. Dealing with Broken Ports
5. The X Window System
5.1. Synopsis
5.2. Terminology
5.3. Installing Xorg
5.4. Xorg Configuration
5.5. Using Fonts in Xorg
5.6. The X Display Manager
5.7. Desktop Environments
5.8. Installing Compiz Fusion
5.9. Troubleshooting
II. Common Tasks
6. Desktop Applications
6.1. Synopsis
6.2. Browsers
6.3. Productivity
6.4. Document Viewers
6.5. Finance
7. Multimedia
7.1. Synopsis
7.2. Setting Up the Sound Card
7.3. MP3 Audio
7.4. Video Playback
7.5. TV Cards
7.6. MythTV
7.7. Image Scanners
8. Configuring the FreeBSD Kernel
8.1. Synopsis
8.2. Why Build a Custom Kernel?
8.3. Finding the System Hardware
8.4. The Configuration File
8.5. Building and Installing a Custom Kernel
8.6. If Something Goes Wrong
9. Printing
9.1. Quick Start
9.2. Printer Connections
9.3. Common Page Description Languages
9.4. Direct Printing
9.5. LPD (Line Printer Daemon)
9.6. Other Printing Systems
10. Linux® Binary Compatibility
10.1. Synopsis
10.2. Configuring Linux® Binary Compatibility
10.3. Advanced Topics
III. System Administration
11. Configuration and Tuning
11.1. Synopsis
11.2. Starting Services
11.3. Configuring cron(8)
11.4. Managing Services in FreeBSD
11.5. Setting Up Network Interface Cards
11.6. Virtual Hosts
11.7. Configuring System Logging
11.8. Configuration Files
11.9. Tuning with sysctl(8)
11.10. Tuning Disks
11.11. Tuning Kernel Limits
11.12. Adding Swap Space
11.13. Power and Resource Management
12. The FreeBSD Booting Process
12.1. Synopsis
12.2. FreeBSD Boot Process
12.3. Configuring Boot Time Splash Screens
12.4. Device Hints
12.5. Shutdown Sequence
13. Security
13.1. Synopsis
13.2. Introduction
13.3. One-time Passwords
13.4. TCP Wrapper
13.5. Kerberos
13.6. OpenSSL
13.7. VPN over IPsec
13.8. OpenSSH
13.9. Access Control Lists
13.10. Monitoring Third Party Security Issues
13.11. FreeBSD Security Advisories
13.12. Process Accounting
13.13. Resource Limits
13.14. Shared Administration with Sudo
14. Jails
14.1. Synopsis
14.2. Terms Related to Jails
14.3. Creating and Controlling Jails
14.4. Fine Tuning and Administration
14.5. Updating Multiple Jails
14.6. Managing Jails with ezjail
15. Mandatory Access Control
15.1. Synopsis
15.2. Key Terms
15.3. Understanding MAC Labels
15.4. Planning the Security Configuration
15.5. Available MAC Policies
15.6. User Lock Down
15.7. Nagios in a MAC Jail
15.8. Troubleshooting the MAC Framework
16. Security Event Auditing
16.1. Synopsis
16.2. Key Terms
16.3. Audit Configuration
16.4. Working with Audit Trails
17. Storage
17.1. Synopsis
17.2. Adding Disks
17.3. Resizing and Growing Disks
17.4. USB Storage Devices
17.5. Creating and Using CD Media
17.6. Creating and Using DVD Media
17.7. Creating and Using Floppy Disks
17.8. Backup Basics
17.9. Memory Disks
17.10. File System Snapshots
17.11. Disk Quotas
17.12. Encrypting Disk Partitions
17.13. Encrypting Swap
17.14. Highly Available Storage (HAST)
18. GEOM: Modular Disk Transformation Framework
18.1. Synopsis
18.2. RAID0 - Striping
18.3. RAID1 - Mirroring
18.4. RAID3 - Byte-level Striping with Dedicated Parity
18.5. Software RAID Devices
18.6. GEOM Gate Network
18.7. Labeling Disk Devices
18.8. UFS Journaling Through GEOM
19. The Z File System (ZFS)
19.1. What Makes ZFS Different
19.2. Quick Start Guide
19.3. zpool Administration
19.4. zfs Administration
19.5. Delegated Administration
19.6. Advanced Topics
19.7. Additional Resources
19.8. ZFS Features and Terminology
20. Other File Systems
20.1. Synopsis
20.2. Linux® File Systems
21. Virtualization
21.1. Synopsis
21.2. FreeBSD as a Guest on Parallels for Mac OS® X
21.3. FreeBSD as a Guest on Virtual PC for Windows®
21.4. FreeBSD as a Guest on VMware Fusion for Mac OS®
21.5. FreeBSD as a Guest on VirtualBox
21.6. FreeBSD as a Host with VirtualBox
21.7. FreeBSD as a Host with bhyve
21.8. FreeBSD as a Xen™-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. Updating FreeBSD from Source
23.6. Tracking for Multiple Machines
24. DTrace
24.1. Synopsis
24.2. Implementation Differences
24.3. Enabling DTrace Support
24.4. Using DTrace
25. USB Device Mode / USB OTG
25.1. Synopsis
25.2. USB Virtual Serial Ports
25.3. USB Device Mode Network Interfaces
25.4. USB Virtual Storage Device
IV. Network Communication
26. Serial Communications
26.1. Synopsis
26.2. Serial Terminology and Hardware
26.3. Terminals
26.4. Dial-in Service
26.5. Dial-out Service
26.6. Setting Up the Serial Console
27. PPP
27.1. Synopsis
27.2. Configuring PPP
27.3. Troubleshooting PPP Connections
27.4. Using PPP over Ethernet (PPPoE)
27.5. Using PPP over ATM (PPPoA)
28. Electronic Mail
28.1. Synopsis
28.2. Mail Components
28.3. Sendmail Configuration Files
28.4. Changing the Mail Transfer Agent
28.5. Troubleshooting
28.6. Advanced Topics
28.7. Setting Up to Send Only
28.8. Using Mail with a Dialup Connection
28.9. SMTP Authentication
28.10. Mail User Agents
28.11. Using fetchmail
28.12. Using procmail
29. Network Servers
29.1. Synopsis
29.2. The inetd Super-Server
29.3. Network File System (NFS)
29.4. Network Information System (NIS)
29.5. Lightweight Directory Access Protocol (LDAP)
29.6. Dynamic Host Configuration Protocol (DHCP)
29.7. Domain Name System (DNS)
29.8. Apache HTTP Server
29.9. File Transfer Protocol (FTP)
29.10. File and Print Services for Microsoft® Windows® Clients (Samba)
29.11. Clock Synchronization with NTP
29.12. iSCSI Initiator and Target Configuration
30. Firewalls
30.1. Synopsis
30.2. Firewall Concepts
30.3. PF
30.4. IPFW
30.5. IPFILTER (IPF)
31. Advanced Networking
31.1. Synopsis
31.2. Gateways and Routes
31.3. Wireless Networking
31.4. USB Tethering
31.5. Bluetooth
31.6. Bridging
31.7. Link Aggregation and Failover
31.8. Diskless Operation with PXE
31.9. IPv6
31.10. Common Address Redundancy Protocol (CARP)
31.11. VLANs
V. Appendices
A. Obtaining FreeBSD
A.1. CD and DVD Sets
A.2. FTP Sites
A.3. Using Subversion
A.4. 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. Websites
C.2. Mailing Lists
C.3. Usenet Newsgroups
C.4. Official Mirrors
D. OpenPGP Keys
D.1. Officers
FreeBSD Glossary
Index
List of Figures
2.1. FreeBSD Boot Loader Menu
2.2. FreeBSD Boot Options Menu
2.3. Welcome Menu
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. Partitioning Choices on FreeBSD 9.x
2.12. Partitioning Choices on FreeBSD 10.x and Higher
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. Analyzing 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
31.1. PXE Booting Process with NFS Root Mount
List of Tables
2.1. Partitioning Schemes
3.1. Utilities for Managing User Accounts
3.2. UNIX® Permissions
3.3. Disk Device Names
3.4. Common Environment Variables
5.1. XDM Configuration Files
7.1. Common Error Messages
9.1. Output PDLs
12.1. Loader Built-In Commands
12.2. Kernel Interaction During Boot
13.1. Login Class Resource Limits
16.1. Default Audit Event Classes
16.2. Prefixes for Audit Event Classes
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
23.1. FreeBSD Versions and Repository Paths
26.1. RS-232C Signal Names
26.2. DB-25 to DB-25 Null-Modem Cable
26.3. DB-9 to DB-9 Null-Modem Cable
26.4. DB-9 to DB-25 Null-Modem Cable
29.1. NIS Terminology
29.2. Additional Users
29.3. Additional Systems
29.4. DNS Terminology
30.1. Useful pfctl Options
31.1. Commonly Seen Routing Table Flags
31.2. Station Capability Codes
31.3. Reserved IPv6 Addresses
List of Examples
2.1. Creating Traditional Split File System Partitions
3.1. Install a Program As the Superuser
3.2. Adding a User on FreeBSD
3.3. rmuser Interactive Account Removal
3.4. Using chpass as Superuser
3.5. Using chpass as Regular User
3.6. Changing Your Password
3.7. Changing Another User's Password as the Superuser
3.8. Adding a Group Using pw(8)
3.9. Adding User Accounts to a New Group Using pw(8)
3.10. Adding a New Member to a Group Using pw(8)
3.11. Using id(1) to Determine Group Membership
3.12. Sample Disk, Slice, and Partition Names
3.13. Conceptual Model of a Disk
5.1. Select Intel® Video Driver in a File
5.2. Select Radeon Video Driver in a File
5.3. Select VESA Video Driver in a File
5.4. Select scfb Video Driver in a File
5.5. Set Screen Resolution in a File
5.6. Manually Setting Monitor Frequencies
5.7. Setting a Keyboard Layout
5.8. Setting Multiple Keyboard Layouts
5.9. Enabling Keyboard Exit from X
5.10. Setting the Number of Mouse Buttons
11.1. Sample Log Server Configuration
11.2. Creating a Swap File on FreeBSD 10.X and Later
11.3. Creating a Swap File on FreeBSD 9.X and Earlier
12.1. boot0 Screenshot
12.2. boot2 Screenshot
12.3. Configuring an Insecure Console in /etc/ttys
13.1. Create a Secure Tunnel for SMTP
13.2. Secure Access of a POP3 Server
13.3. Bypassing a Firewall
14.1. mergemaster(8) on Untrusted Jail
14.2. mergemaster(8) on Trusted Jail
14.3. Running BIND in a Jail
17.1. Using dump over ssh
17.2. Using dump over ssh with RSH Set
17.3. Backing Up the Current Directory with tar
17.4. Restoring Up the Current Directory with tar
17.5. Using ls and cpio to Make a Recursive Backup of the Current Directory
17.6. Backing Up the Current Directory with pax
18.1. Labeling Partitions on the Boot Disk
23.1. Increasing the Number of Build Jobs
26.1. Configuring Terminal Entries
29.1. Reloading the inetd Configuration File
29.2. Mounting an Export with amd
29.3. Mounting an Export with autofs(5)
29.4. Sample /etc/ntp.conf
31.1. LACP Aggregation with a Cisco® Switch
31.2. Failover Mode
31.3. Failover Mode Between Ethernet and Wireless Interfaces

All FreeBSD documents are available for download at https://download.freebsd.org/ftp/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>.