This article originally appeared in the January 2002 issue of the Dæmon News Online Magazine. This is a cleaned-up version of the article with minor style edits and made it HTML5 compliant; else, the content has not been changed.
Title: FreeBSD Unleashed
Authors: Michael Urban and Brian Tiemann
Publisher: Sams Publishing
One of the complaints about FreeBSD (or many open source projects) is the lack of documentation, primarily documentation that is written for those who haven't had a lot of hands-on experience with Unix. In the past several months, two great books about FreeBSD: "FreeBSD Corporate Networker's Guide" and "FreeBSD: An Open-Source Operating System For Your Personal Computer" were published to help provide some guidance to those who are in a corporate or a home environment respectively. In October 2001, "FreeBSD Unleashed" was published with a goal to provide a guide that ranges in topics from the very basics of FreeBSD to building a secure and multi-talented FreeBSD workstation or server.
The book covers a lot of topics, as the size and weight of it show. It is organized into six parts, which are broken into thirty-four chapters and four appendices. The first five parts of the book are ordered so that it starts off with the basics of FreeBSD and progresses up to the more technical and detailed topics like security and networking services. There is one note to make about the CDs that are included with the book: the list of software included on page 5 of the book is incorrect. Instead of what is listed, the two CDs packaged with the book are the first CD of the FreeBSD 4.4-RELEASE four-CD set and a special snapshot of the FreeBSD 5.0-CURRENT branch. Below you can find the table of contents for the book.
Part I - Introduction to FreeBSD
Part II - Using FreeBSD
Part III - Administering FreeBSD
Part IV - FreeBSD Networking
Part V - X-Windows
Part VI - Appendices
Part I of the book introduces what FreeBSD and Unix are, what FreeBSD can do, how it compares to Linux and Windows 2000, why the dæmon is used as the mascot for FreeBSD, and the installation process in detail. One interesting note about chapter one is that the authors touch on the design philosophy of Unix in general, primarily the idea of keeping the programs simple and using pipes to extend functionality when the user needs and wants to use it. One tiny gripe that I have is that the book compares FreeBSD with Windows 2000, but focuses too much on the GUI and does not mention the advantages of FreeBSD, primarily that it is open source and that it has superior stability and performance over Windows NT/2000.
Chapters two and three are dedicated to the installation process and problems that could come up. The second chapter goes into creating the boot floppies (or a boot floppy for those lucky enough to have a 2.88MB floppy drive), a detailed explanation of partitions, slices and mount points as well as fdisk and the disk label editor, and the post-installation options. Since many of the options in the post-installation menu are covered in the later chapters, each option is skimmed over, with the exception of using the graphical setup utility to configure XFree86 3.3.6. A warning is given to the reader that incorrect monitor settings can cause to damage to the monitor, but does not provide any pointers on how to find the refresh rate and frequency limits of a monitor. One typo is on page 60 where "XF96Setup" is written, it should be "XF86Setup". The rest of the chapter covers adding users and groups, and the proper way to shutdown a FreeBSD box.
Chapter three goes over installing FreeBSD along side of another operating system like Windows 2000 or Linux. An run-down of what FIPS can and cannot do, possible problems with dual booting such as the famous 1024th cylinder limitation, using either FreeBSD's boot manager or LILO, and installing via FTP or NFS. Since the chapter is called "Advanced Installation Issues", it is somewhat disappointing that installing via FTP and NFS are covered, but not installing over a PPP/PPPoE connection as these are common Internet connection methods.
Part II of the book introduces the user's environment to the reader, including the boot and the login process, halting and rebooting the system, setting up the Gnome desktop environment and getting dirty with the shell. Chapter four focuses on what happens when the computer is started, how it loads up FreeBSD from either the master boot record or from a boot manager, the loading of the kernel, the hardware detection process, the startup scripts, and the login prompt. The end of the chapter provides an introduction to chapters five and six, the Gnome user interface, as well as the proper way to shut down the system.
Chapters five and six cover using and navigating through the Gnome desktop environment, customizing the interface and applications, and tweaking the Sawfish window manager. The authors do mention that Gnome is not a window manager but rather needs a separate window manager, something that many people still get confused. The reader is provided with a wealth of information on how to use the interface, the different applets included (like the CD player), working with icons, and the customization options available (including themes, file and MIME types). Although I think the authors did a great job with teaching the reader about Gnome, unfortunately window managers like Blackbox or Window Maker are not discussed or mentioned as alternatives to Gnome until near the end of the book.
Covered in chapter seven are desktop applications, which includes an overview of text editors such as
vi (but not Emacs) and a tutorial on The GIMP graphics editor. Also
included in the chapter is a walk-through of Star Office 5.2, playing audio and video files. How to
browse the Internet, pulling files via FTP and checking your spam, er e-mail finish up the chapter. A
thumbs up should be given to the authors for providing key maps and commands for
vi and an
explanation of a
diff output, but I think that The GIMP and Star Office sections could have
been trimmed down a bit by providing a highlight of both applications rather than a detailed HOWTO.
The reader is introduced to the shell environment in chapter eight. The different shell options are
presented and explained to the reader as well as a little history behind each one, though the
bash shell is the one referenced throughout most of the chapter. The chapter covers basics
like searching the man pages, working with directories, using commands like
soft versus hard links, wildcards, and text manipulation commands.
Once familiar with the basic command line and/or graphical programs, Part III leads the reader into maintaining the FreeBSD installation. In this part of the book, the reader learns more about the FreeBSD file system, user management and permissions, more in-depth topics regarding the shell and an introduction into shell programming, processes, and the Ports and Package systems. The latter portion of Part III covers what the reader can do with the sources by configuring the kernel or keeping up to date with -STABLE or -CURRENT, migrating from other operating systems to FreeBSD, performance tuning and an introduction to programming with Perl.
Chapters nine talks about the FreeBSD directory structure, the strict rule that is installed by the
administrator should be placed under
/usr/local and mounting and unmounting file systems
and removable disks. Also in the chapter is an overview of
a discussion about soft updates versus journaling file systems, how to fix damaged super blocks,
setting up and maintaining quotas, and the difference between blocks, files and inodes. The chapter
tends to jump from one topic to a different, then goes back to the previous topic. This can cause
some unnecessary page flipping for the reader and could cause some confusion.
Chapter ten goes over the concept of users, groups and permissions, how they relate to the security of the system and to file access privileges, and user management. One of the interesting topics discussed in the chapter is the idea of access control lists that are available in 5.0-CURRENT, the differences that it has over the standard flat user/group permissions, and how to manage ACLs. The chapter does a good job of explaining file and directory permissions and provides information to reduce the chance of the reader getting locked out of a resource.
Chapters eleven through thirteen revolve around system configuration files and scripts, further
customization of the shell, and writing shell scripts for either the Bourne shell or the Korn shell.
Chapter eleven re-caps the boot and startup process, introduces the resource configuration (i.e.:
rc) files, the
inetd dæmon and configuration file, and configuring the syslog
dæmon. An in-depth walk-through of shells is covered in chapter twelve with topics like installing
different shells from packages or ports, changing the shell on the fly or the default shell for the user,
and setting up the shell initialization files for
csh (which has since been replaced with
tcsh) and the Bourne-like shells. The chapter closes with changing the shell prompt and a
quick touch on variables.
Chapter thirteen is probably one of most detailed chapters in the book, as it covers writing shell
scripts and programs. The reader is introduced to the often chaotic but powerful world of writing Bourne
or Korn shell scripts. C shell scripting is not covered as it can be a lot of headaches and that Bourne
shell scripts are considered a de-facto standard. The chapter covers variables, getting user input from
a running script or from the command arguments, using
expr for basic number crunching, loops,
shifting arguments, the
case structures, exit status, functions,
stderr, and debugging scripts. The last portion of the chapter covers
features that are available in the Korn shell that aren't available in the Bourne shell.
Monitoring performance, process control and automating jobs are the topics found in Chapter fourteen.
The chapter shows how the reader to use
top to see how pegged the system is and what memory
resources are available, as well as deciphering the different counters and values shown in outputs
kill command is covered along with the different
signals that can be sent to a process. Unfortunately, the
killall command is not covered,
even though it uses the same signals as
kill but it can be more dangerous. The last items
covered in the chapter include being
nice to a process and working with the
dæmon and setting up a
Chapter fifteen covers how to install, un-install and update packages and ports available for FreeBSD.
sysinstall and the
pkg_add methods of installing packages are provided
along with a disclaimer that not all software available for FreeBSD are in a package format. The rest
of the chapter covers the guts of the Ports system and collection, what a Port really is and how to
install, upgrade or remove a Port. The FreshPorts site is
mentioned on the last page of the chapter.
Printing in all of its glory (and headaches) is the topic of chapter sixteen. The reader is presented with the print spooler and the line printer dæmon along with configuring the parallel port, setting up filters for PostScript and non-PostScript printers, printing from the command line or from X Windows applications, and managing the printer. For those with networked printers served off of Windows or Samba servers or have USB printers are out of luck here as there is no mention of setting up a printer in either environment.
Chapter seventeen and eighteen provides the reader with information on two of the many things that could
be done with the source code of FreeBSD, configuring and compiling the kernel, and keeping up to date
with -STABLE or -CURRENT. Chapter seventeen explains what the kernel is and what it does, why the reader
would customize the kernel, an overview of the
GENERIC and the
LINT kernel configuration
files, make a custom configuration file, compiling and installing the custom kernel, and tips to recover
from a bad kernel compile.
Chapter eighteen goes over the -STABLE and the -CURRENT branches (and does a good job at it as well), what
make world process is and provides steps and tips throughout the process as well as
pointing out the possible hurdles and problem points. The steps provided are really detailed and are
straightforward, which are welcome to many FreeBSD users.
The authors return to hard disks and file systems in chapter nineteen to focus on the different access modes available for IDE/ATA hard drives, SCSI drives, hard drive geometries, partitions, slices and mounting file systems. The chapter is a little slim, but it provides just enough information to answer any remaining questions that the reader has on the different terminologies used.
For those who are looking at moving from one operating system (say Linux or Windows 2000) to FreeBSD,
the first portion of chapter twenty should provide a wealth of information to help tackle such a move.
The rest of the chapter includes a list of Do's and Don'ts that the reader (or any FreeBSD user) should
follow. Some of them should already be second nature for those who administer any number of FreeBSD
(or Unix) systems. One of the Don'ts that got me chuckling was "Don't get hung up on uptime."
:-) The chapter finishes up with instructions on how to enable soft updates or asynchronous writes on a
system that is already up and running, tuning up with
sysctl, and setting up backups and mirrors.
The reader gets introduced to Perl programming in chapter twenty-one. The chapter was not meant to teach everything about Perl to the reader, but just the basic concepts, structures, regular expressions, reading/writing files, and using Perl modules. A list of Perl resources like web sites and books are included at the end of the chapter, in which the reader can continue to learn more about Perl. The examples included in the chapter are readable and are easily understood and even includes a simple table of regular expression operators.
Connecting to a network and the Internet, and setting up network services like Apache and mail are the topics that make up Part IV of the book. A brief introduction to the concept of networking and the Internet starts off chapter twenty-two, then progresses to different (and quite generalized) network topologies (which is misspelled as "Tyopologies" on page 569) and wide area network link types (like ISDN, T1/DS1 and OC-3/STM-1) and speeds, and then onto components found in most local and wide-area networks. One nice touch in the chapter were the two diagrams showing the difference between a straight-through cable and a crossover cable. The chapter lacked information about fiber-optic components, as they are getting more popular in Gigabit Ethernet and long-run network installations.
The second half of chapter twenty-two goes delves into the TCP/IP protocol suite as the different components (TCP, UDP and IP) of the suite are discussed as well as ARP and MAC addresses. Subnets and subnet masks are also covered though it doesn't get as detailed (and confusing) as some Cisco Press books can be. The chapter wraps up with a quick briefing on routing, host and domain names, and DHCP. I personally think that any introduction to network should include an brief overview of the OSI model, which was not included in this book.
Chapter twenty-three and twenty-four covers configuring a FreeBSD box to access a network through a
network card and through a PPP connection respectively. A list of supported network cards in the
GENERIC kernel is provided, along with configuring network settings through the
sysinstall utility, manually by using
route, or by using
/etc/rc.conf. The authors do cover the
/etc/netstart script which when executed
will reload the network configuration from
/etc/rc.conf without having to reboot the
computer. Setting up the
/etc/resolv.conf wrap up chapter twenty-three.
Chapter twenty-four covers both user PPP and kernel PPP, the differences, and how to configure both of them along with dial-on-demand and persistent connections. Unfortunately, both PPPoE and WinModems are not covered in this chapter which leaves out quite a few readers as more and more telcos and DSL providers are using PPPoE rather than straight DSL. Since WinModems are not mentioned as unusable under FreeBSD, this can cause some grief to many readers as almost all of the computers and laptops sold with modems bundle WinModems rather than hardware modems.
Internet services like e-mail, web and FTP serving are the topics covered in chapters twenty-five through twenty-seven respectively. An introduction to the SMTP protocol along with a sample SMTP session via Telnet starts off chapter twenty-five, then progresses onto the differences and functions of mail transfer agents (MTAs) and mail user agents (MUAs), and then moves on to setting up Sendmail. A short description of the Sendmail configuration files and the mail queue is included. The authors do make a mention of the potential problems of mail relaying and how to open up relaying. An introduction and setting up POP3 and IMAP dæmons, setting up Fetchmail and a list of Sendmail alternatives round out the chapter.
Chapter twenty-six introduces the HTTP protocol and web serving to the reader. As part of the introduction to the HTTP protocol, the authors include a nice table of HTTP response codes and how web browsers and web servers interact with each other. The rest of the chapter is dedicated to installing and configuring the Apache web server and a touch of writing CGI scripts in Perl. Instructions on how to set up access lists based on addresses and user authentication, virtual hosting, Apache modules and server-side includes are also included. After finishing the chapter, the reader should be ready to get the FreeBSD box up and running with a basic website without having to rely too much on the Apache manual. Chapter twenty-seven provides a look at how FTP connections are made, the differences between anonymous and authenticated FTP, and setting up the FTP dæmon.
Setting up a FreeBSD as a NAT gateway/router is the topic of Chapter twenty-eight. The chapter starts
off with a look at what routing between multiple networks is, what a gateway does and how it can use
IPFIREWALL, setting up clients to use the new gateway
(with instructions to configure Windows, Mac OS and some Linux clients), a touch on setting up a
wireless network gateway, and routing between more than two networks.
Once a FreeBSD computer is on a network, getting the computer secure is one of the most important
things to do. Chapter twenty-nine focuses on things the reader can do to increase the security of
the machine either through software or through policies. The chapter teaches about different
security risks and models, how to make sure passwords are strong enough to avoid dictionary attacks,
setting up passwords to expire or through S/Key for one-time passwords, setting up and using
OpenSSH for secure terminal access, as well as using OpenSSL to secure POP3 and IMAP. Security FTP
and Apache starts off the second half of the chapter, then continues on with system security
securelevel (it also includes a table of what is enabled and/or disabled for
each security profile available in
sysinstall), configuring a firewall, setting up and
using PortSentry and Tripwire, and tips on what to do if you think the system is being hacked, what
and how to reduce the risk of denial of service attacks, what can be done to increase the physical
security of the box, and resources available to find out about security exploits and fixes. This
chapter is one of the most thorough and helpful chapters in the book as it can provide insights for
both new and experienced FreeBSD users.
Chapter thirty focuses on setting up BIND on the system for domain name server services. The chapter starts off with an overview of what DNS is and the terminology commonly used with DNS and BIND. The reader is presented with steps to enable and configure BIND as well as setting up BIND to run within a sandbox (which is recommended since BIND has been known to have some nasty exploits in the past), restricting access to the name server, setting up zones to serve, and setting up a caching-only name server.
The next two chapters, thirty-one and thirty-two cover file serving using NFS and Samba, as well as
using Samba as a print server for Windows machines. Chapter thirty-one's topic is NFS and it provides
information on what NFS is and how it works from a user standpoint, setting up the NFS dæmon,
setting up NFS shares via
/etc/exports, setting up a client to mount the NFS shares, and using
the auto-mount dæmon to mount shares when needed. Chapter thirty-two focuses on file and print
services for Windows machines by using Samba and provides steps to set up Samba, configuring Samba
smb.conf configuration file or through the SWAT web-based interface, and how to
mount Windows or Samba shares with
smbfs. Just a note for those thinking of setting up Samba
as a Windows NT domain controller will need to refer elsewhere. For those who work with Macintosh
computers, the authors do mention the
netatalk port to provide AppleTalk file services but
don't provide any instructions to set it up.
Chapter thirty-three provides a quick introduction to DHCP including the advantages of using DHCP to
assign IP addresses over assigning static IP addresses, enabling DHCP on the client via
or manually by enabling it in
/etc/rc.conf and configuring the
dhclient program, and
setting up the ISC-DHCP server dæmon. The steps provided to configure the DHCP server are based on
dhcpconf program rather than manually hacking the
The last chapter in the book covers more advanced configuration of X-Windows such as upgrading from
XFree86 3.3.6 to 4.x and installing the
Xwrapper port, using
SuperProbe to detect
the video card, using
xf86config to set up XFree86, deciphering the
file, setting up the
.xinitrc file to change the window manager between Blackbox, Window
Maker and Gnome, setting up X to use True Type fonts, connecting to a remote X-Windows host, and
xdm to provide a graphical login prompt.
Part VI of the book contains four appendices: a command reference and a list of commonly used configuration files, system requirements and supported hardware including a long list of video cards supported by XFree86, tips on troubleshooting common installation and post-installation problems. The last appendix includes a list of FreeBSD resources available on-line as well as general BSD web sites, and a list of other open source project site, as well as Unix and X-Windows newgroups.
According to the "User Level" stated on the back of the book, this book was written for those with intermediate to advanced computer knowledge. I do have to agree with it as the reader should know how a computer works and be comfortable with taking risks. There are times where the book veers away from the targetted audience, such as the tutorial on The GIMP and Star Office, but it doesn't dumb down the content so far that the technical information is lost.
Since this is the first edition of the book, some typos are acceptable and last-minute changes are hard to correct when the book has already been sent to the printing stages. One of the last-minute changes that occurred was that CD2 now has complete -RELEASE like snapshot of FreeBSD 5.0, which is nice for those who don't want to build up to -CURRENT. For others, the copy of Star Office 5.2 that wasn't included as stated in the book might be disappointed. As noted, there are some items that should be included in the next edition of the book, primarily the bits about installing over PPP/PPoE and a mention about the inability to use WinModems in FreeBSD.
Overall, I really liked the book and it definitely deserves a space on my cluttered bookself, next to the other FreeBSD books that I have. Would I recommend it? I would recommend the book for those who want to dabble into the world of Unix and BSD as well as those who would like to expand their knowledge of FreeBSD. The book is also a good guide for those who want to migrate from a Windows NT/2000 environment to a FreeBSD/Unix environment.
Article copyright © 2002–2010 Linh Pham. All rights reserved. Re-production of portions of this work, or its entirety, requires permission of the copyright holder.