================ FreeBSD Handbook ================ .. raw:: html .. raw:: html
.. raw:: html
.. raw:: html
.. raw:: html
.. raw:: html
.. raw:: html
.. raw:: html
The FreeBSD Documentation Project ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. raw:: html
.. raw:: html
.. raw:: html
Revision: ` `__ .. raw:: html
.. raw:: html
Copyright ? 1995-2015 The FreeBSD Documentation Project .. raw:: html
.. raw:: html
`Copyright `__ .. raw:: html
.. raw:: html
`Legal Notice `__ .. raw:: html
.. raw:: html
Last modified on by . .. raw:: html
.. raw:: html
.. raw:: html
.. raw:: html
Abstract .. raw:: html
Welcome to FreeBSD! This handbook covers the installation and day to day use of *FreeBSD 8.4-RELEASE*, *FreeBSD 9.3-RELEASE*, and *FreeBSD 10.1-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 <../../../../search/index.html>`__. .. raw:: html
.. raw:: html
.. raw:: html
-------------- .. raw:: html
.. raw:: html
.. raw:: html
Table of Contents .. raw:: html
`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. 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. 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 pkg 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. Quick Start `__ `6.5. Xorg Configuration `__ `6.6. Using Fonts in Xorg `__ `6.7. The X Display Manager `__ `6.8. Desktop Environments `__ `6.9. Installing Compiz Fusion `__ `6.10. 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. FreeBSD Boot Process `__ `13.3. Configuring Boot Time Splash Screens `__ `13.4. Device Hints `__ `13.5. 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 `__ `15.6. Managing Jails with ezjail `__ `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. Adding Disks `__ `18.3. Resizing and Growing Disks `__ `18.4. USB Storage Devices `__ `18.5. Creating and Using CD Media `__ `18.6. Creating and Using DVD Media `__ `18.7. Creating and Using Floppy Disks `__ `18.8. Backup Basics `__ `18.9. Memory Disks `__ `18.10. File System Snapshots `__ `18.11. Disk Quotas `__ `18.12. Encrypting Disk Partitions `__ `18.13. Encrypting Swap `__ `18.14. Highly Available Storage (HAST) `__ `19. GEOM: Modular Disk Transformation Framework `__ `19.1. Synopsis `__ `19.2. RAID0 - Striping `__ `19.3. RAID1 - Mirroring `__ `19.4. RAID3 - Byte-level Striping with Dedicated Parity `__ `19.5. Software RAID Devices `__ `19.6. GEOM Gate Network `__ `19.7. Labeling Disk Devices `__ `19.8. UFS Journaling Through GEOM `__ `20. The Z File System (ZFS) `__ `20.1. What Makes ZFS Different `__ `20.2. Quick Start Guide `__ `20.3. ``zpool`` Administration `__ `20.4. ``zfs`` Administration `__ `20.5. Delegated Administration `__ `20.6. Advanced Topics `__ `20.7. Additional Resources `__ `20.8. ZFS Features and Terminology `__ `21. Other File Systems `__ `21.1. Synopsis `__ `21.2. Linux? File Systems `__ `22. Virtualization `__ `22.1. Synopsis `__ `22.2. FreeBSD as a Guest OS `__ `22.3. FreeBSD as a Host with VirtualBox `__ `22.4. FreeBSD as a Host with bhyve `__ `23. Localization - i18n/L10n Usage and Setup `__ `23.1. Synopsis `__ `23.2. Using Localization `__ `23.3. Finding i18n Applications `__ `23.4. Locale Configuration for Specific Languages `__ `24. Updating and Upgrading FreeBSD `__ `24.1. Synopsis `__ `24.2. FreeBSD Update `__ `24.3. Updating the Documentation Set `__ `24.4. Tracking a Development Branch `__ `24.5. Synchronizing Source `__ `24.6. Rebuilding World `__ `24.7. Tracking for Multiple Machines `__ `25. DTrace `__ `25.1. Synopsis `__ `25.2. Implementation Differences `__ `25.3. Enabling DTrace Support `__ `25.4. Using DTrace `__ `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) `__ `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. Websites `__ `C.2. Mailing Lists `__ `C.3. Usenet Newsgroups `__ `C.4. Official Mirrors `__ `D. OpenPGP Keys `__ `D.1. Officers `__ `FreeBSD Glossary `__ `Index `__ .. raw:: html
.. raw:: html
.. raw:: html
List of Figures .. raw:: html
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. `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 `__ 31.1. `PXE Booting Process with NFS Root Mount `__ .. raw:: html
.. raw:: html
.. raw:: html
List of Tables .. raw:: html
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 Names `__ 4.4. `Common Environment Variables `__ 6.1. `XDM Configuration Files `__ 8.1. `Common Error Messages `__ 10.1. `Output PDLs `__ 13.1. `Loader Built-In Commands `__ 13.2. `Kernel Interaction During Boot `__ 14.1. `Login Class Resource Limits `__ 17.1. `Default Audit Event Classes `__ 17.2. `Prefixes for Audit Event Classes `__ 23.1. `Common Language and Country Codes `__ 23.2. `Defined Terminal Types for Character Sets `__ 23.3. `Available Console from Ports Collection `__ 23.4. `Available Input Methods `__ 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 `__ .. raw:: html
.. raw:: html
.. raw:: html
List of Examples .. raw:: html
2.1. `Creating Traditional Split File System 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 Swap File on FreeBSD?10.\ *``X``* and Later `__ 12.3. `Creating a Swap File on FreeBSD?9.\ *``X``* and Earlier `__ 13.1. ```boot0`` Screenshot `__ 13.2. ```boot2`` Screenshot `__ 13.3. `Configuring 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 `__ 15.1. `mergemaster(8) on Untrusted Jail `__ 15.2. `mergemaster(8) on Trusted Jail `__ 15.3. `Running BIND in a Jail `__ 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. `Using\ ``ls`` and ``cpio`` to Make a Recursive Backup of the Current Directory `__ 18.6. `Backing Up the Current Directory with ``pax`` `__ 19.1. `Labeling Partitions on the Boot Disk `__ 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 `__ .. raw:: html
.. raw:: html
.. raw:: html 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 . | Send questions about this document to .