Slashdot Mirror


BSD Hacks

GMan00 writes "A flurry of BSD UNIX-related (Berkeley Software Distribution) books have hit the bookstores during the recent past, and more are on the way. From books specific to Secure Architectures with OpenBSD in April 2004 and the reissue of The Design and Implementation of the BSD Operating System for FreeBSD 5.x (expected in August 2004), to Michael Lucas' series of BSD Books from NoStarch Press, print documentation is certainly available for those interested in learning about the free, open source UNIX system which powers operations such as Yahoo! portal and Sendmail.org website, Verio and Pair hosting, not to mention web server survey site Netcraft. Dru Lavigne's BSD Hacks (O'Reilly and Associates, May 2004), is the latest book in these releases, and is an enormously useful resource for system administrators and end-users alike." Read on for the rest of George's review. BSD Hacks author Dru Lavigne pages 427 publisher O'Reilly & Associates rating 10 reviewer George ISBN 0596006799 summary A great array of hacks you can perform on your BSD box, many applicable to all the BSDs, including FreeBSD, NetBSD, OpenBSD and Darwin/OS X.

Dru writes the BSD Basics column on O'Reilly & Associates' OnLamp. Her clarity and fluid style are perfect for those looking to understand aspects of the BSD operating systems. I have had some email communications with Dru about various New York City *BSD User Group-related activities, and managed to speak with her several times at BSDCan this past May.

Like most computer nerds, Dru has a sense of humor. Unlike most, however, she's actually funny.

BSD Hacks is the first book that is almost solely focused on hacks for sysadmins, without boring you with the details for basic operating system installation and configuration that has been so well documented elsewhere. BSD Hacks is not just for sysadmins, though. Intermediate and advanced BSD users will also find the book an excellent tool. For those who find difficulty in BSD installs and other fundamentals, on the other hand, it's best to start with the FreeBSD Handbook, the NetBSD Guide or the OpenBSD FAQ.

There's lots of good hacks buried in the various BSD books, around the internet in different HOWTOs and tutorials. But BSD hacking is the sole purpose of BSD Hacks; there's no need to browse through install screens and overviews of TCP/IP before getting to the heart of the matter.

With 100 listed hacks, multiplied by an impressive level of detailed angles for each, Dru provides an array that demands the placement of this book right in your server room, not in a pile of "must-read-at-some-distant-point-in-the-future" texts.

The majority of hacks are applicable to all the BSDs, including Darwin and OS X, although some are specific to one BSD or another.

This review obviously can't list every hack, although you would be smart to sit and work through the book yourself over a weekend or two. But it is possible to provide a good flavor of BSD Hacks in brief. O'Reilly and Associates does give a good glimpse on their Sample Hacks page, but let's do a quick work through ourselves.

The first chapter is called "Customizing the User Environment," and is probably best for end-users looking to go beyond their first steps. But it does include some useful hacks, such as "Use an Interactive Shell" that certainly fit well into the arsenal of any sysadmin, not to mention Hack #12 "Use Multiple Screens on One Terminal."

The second chapter, "Dealing with Files and Filesystems" also contains gems for both end-users and sysadmins. The use of mtree, which maps a directory hierarchy, is mentioned as a tool for recovery. Later on in chapter 6, Dru details its use for making a hacked data integrity checker, thus filling the role often played by products such as Tripwire.

Another great tool Dru covers in the second chapter is g4u, a free ghosting program that gives you the ability to perform quick restores over ftp. Ghosting a drive image is an incredibly useful tool, whether it's about replicating servers or doing a quick reinstall and configuration when a server fails in an emergency.

Chapter 3 is entitled "Boot and Login Environments." It gives some hacks that aren't just for basic system administration, but also some useful security ones including changing your /etc/passwd file to Blowfish encryption and utilizing OPIE for one-time passwords, which is built into FreeBSD.

"Backup Up" is the focus of Chapter 4. It includes some very creative methods of dealing with maintaining that necessity, and also includes an excellent primer on Bacula, which is increasingly gaining prominence as a cross-platform backup system.

Chapter 5 covers "Network Hacks," and continues on educating a sysadmin. Included in this chapter is the tcpdump program, a vital tool for watching traffic flowing by your network interfaces.

There's a strong security focus in Chapter 6, entitled "Securing the System." While security hacks are sprinkled generously throughout the book, this chapter works with firewalling with IPF and PF, in addition to covering SSH and Snort. It also includes the earlier mentioned 'intrusion detection-lite' approach with mtree.

Chapter 7, "Going Beyond the Basics" explores scripting, analyzing dreaded buffer overflows and more. Dru also includes a bit on "Creating a Trade Show Demo," not something you'd expect documented in print anywhere, but nevertheless quite useful for anyone working for the BSDs at a conference.

Dru continues with "Keeping Up-to-Date" in Chapter 8, which includes useful details on upgrading and downgrading your installed ports.

The final chapter is "Grokking BSD." "Grok," as Dru comments, refers to the science fiction writer Heinlein's Martian phrase for having a "thorough understanding." Dru covers creating your own manual pages, dealing with custom patches, playing with dictionaries and more.

Certainly there are no walls between each chapter, as many of the hacks could be shifted around. All the more reason to work your way through the book from beginning to end.

One useful addition for this book could have been somehow denoting which of the BSDs (in some cases, it's all of them) to which each listed hack can be applied. Certainly not all are available to Darwin and Apple's OS X. And certainly there's no point in making the OpenBSD /etc/passwd file encrypted in Blowfish, since that is its default.

While many of the hacks are found somewhere in the manual pages, on some useful website, buried in another book or in the minds of some developer somewhere, they're not necessarily in the annals of official documentation. But there's no single book or site that provides the depth and breadth that Dru provides. She managed to tap into the thoughts of dozens of developers and sysadmins around the world, greatly enhancing the variety of hacks in this book.

As a side note, the scope of BSD Hacks isn't limited to just the BSD family. Many of these are likely applicable to Linux and the other UNIX systems. But with recent, impressive increases in the BSD install base, there's a good chance that you can access a BSD box somewhere.

Whether you're a sysadmin managing hundreds of servers, or a power user ready to go beyond the obvious, BSD Hacks belongs next to your CRT.

You can purchase BSD Hacks from bn.com. Slashdot welcomes readers' book reviews. To see your own review here, carefully read the book review guidelines, then visit the submission page.

13 of 122 comments (clear)

  1. Re:*BSD is dying by Anonymous Coward · · Score: 3, Informative

    Good News Everyone!
    Turns out that *BSD is stronger than ever!
    According to an Inernetnews article, Netcraft has confirmed that *BSD has "dramatically increased its market penetration over the last year."
    There has been a steady increase in *BSD developers over the past decade.
    There are currently 307 FreeBSD developers as of the 2004 core team election.
    You can read more about FreeBSD here

    If you would like to try out a BSD, you can download: FreeBSD, OpenBSD, NetBSD, or DragonflyBSD
    Enjoy!

  2. Secure architectures by carnivore302 · · Score: 5, Informative

    I happen to own Secure Architectures with openBSD. While it covers a lot of ground found in other admin books as well, there are some nice things to be found here. Especially the comments on how-not-to-do-it were sometimes... well let's say useful :-)

    Click on the Mystery Futures Link!

    --
    Please login to access my lawn
  3. Re:Legitimate question. by Unnngh! · · Score: 4, Informative

    I've found books help to take me over certain hurdles in learning, particularly with unix. That being said, I kindof need to hit a hurdle for them to be useful, or at least have enough real experience under my belt to see how the material is applicable. Unix Power Tools is a great book, it will show you so many nuts and bolts of any Unix-like OS that it will really put you in another realm. But try picking it up as a noob, it'll only give you a massive headache.

  4. Re:Legitimate question. by Short+Circuit · · Score: 5, Informative

    For me, O'Reilley's Linux in a Nutshell allowed me to charge in with both guns drawn back in 2000. (Read: I'd hosed my Windows installation, and the Compaq restore CD wasn't working.)

    They have books on both Linux and BSD here. And, so long as you have a machine to read them from, check out their Safari service. I loved it. (but had to cancel to pay for tuition last Fall. I'm still planning on going back.)

  5. Re:Legitimate question. by fiskbil · · Score: 3, Informative

    I have read The Design and Implementation of the 4.4 BSD Operating System and it is a very good way to learn the inner workings of an OS. This is an older book than the one mentioned in the article and I'm sure the new book has some more up to date information. But I would expect it to be just as good as the one I mentioned.

    The authors of the book helped in writing BSD and they give the impression of knowing what they are writing about.

  6. BSD Dead? WTF by Anonymous Coward · · Score: 0, Informative

    How Can BSD be dead? I'm running it... it's doing its job... looks alive to me!

  7. Re:Legitimate question. by joeykiller · · Score: 3, Informative
    Is a hacks book a good way to go about learning more about the insides of an OS (BSD) and how it works, or are there other books out there for this purpose?
    I haven't read "BSD Hacks", but I have read O'Reilly's "Linux hacks". If BSD Hacks is anything like the O'Reilly book "Linux hacks", I'd have to say that the answer is no.

    Don't misunderstand -- "Linux hacks" is an awesome book, but it is a book that helps users that have some experience solve a couple of (or more like 100) special problems you really have to experience before you even know they exist. I don't know if this makes any sense, but what I'm trying to say is that it may be more suited for experienced users.

    Since you seem to be an OS X user I think you'd get more help from another O'Reilly book: Learning Unix for Mac OS X Panther. It teaches you the basics and might even get you far enough to experience the kind of situations where you'd start wanting a Hacks book.
  8. Comment removed by account_deleted · · Score: 2, Informative

    Comment removed based on user account deletion

  9. Re:Legitimate question. by value_added · · Score: 2, Informative

    The FreedBSD Handbook (which you can download or read here probably contains everything you need, and then some.

    Reading more than one book on any subject is always a good idea, but when you're starting off, the original documentation (in this case, excellent and well written) should not to be skipped.

  10. Secure Architectures with OpenBSD by zyche · · Score: 4, Informative

    I bought a copy of Secure Architectures with OpenBSD and I think it is quite good, especially if you consider its relatively low price.

    It's not that it cover every detail of every feature of OpenBSD, rather it many gives some background to them that the (ohh so excellent) man pages doesn't provide. For example: while the man page explain what rarpd does, the book admits that the service is quite archaic. :-)

    I like it, and have learned a lot from it, even then I thought I knew most of it (or know where to look).

  11. Re:Legitimate question. by chromatic · · Score: 4, Informative

    The goal of a Hacks book is much different from a Cookbook. A Cookbook will cover everything common you'll eventually want to do. A Hack will cover things you may never have known you want to do, but will want to do after you read them.

    (I edited this book, so that was my goal at least.)

  12. Re:*BSD is dying by Anonymous Coward · · Score: 1, Informative

    Dragonfly BSD....a BSD I have not tried yet? Thanks, I'll look into it shortly.

    For those of you that think BSD is dead, look at Net|Scaler. It's clients inlcude WebEx, MSN, AOL, Amazon, Google, Yahoo, Royal Bank of Scotland, Autozone.com and thousands of other high volume, high traffic, sites. These sites demand the highest consideration for uptime, reliablity, throughput, and management functions. They all rely on the BSD based Net|Scaler to load balance, SSL offload, Content Switch, URL Filter and protect their back-end server farms.

  13. Re:FreeBSD vs Linux -- check it out by torstenvl · · Score: 2, Informative

    Look at some of the most popular sites out there:

    • www.slashdot.org: Linux
    • www.sourceforge.net: Linux
    • www.hotmail.com: Win2K
    • www.msn.com: Win2K (w/ FreeBSD backup?)
    • www.netcraft.com: FreeBSD
    • www.yahoo.com: FreeBSD
    • www.google.com: Linux
    • www.apache.org: FreeBSD (this one gets weight, I believe)
    • www.oracle.com: Solaris
    • www.mozilla.org: Linux
    Some other sites:
    • www.x.org: Solaris
    • www.xfree86.org: FreeBSD (heh)
    • mac.com: Darwin & BSD/OS (some back and forth)
    • www.stanford.edu: Solaris
    • www.berkeley.edu: Solaris (eh!?)
    • www.mit.edu: Solaris
    • www.wmich.edu: Solaris
    • www.gatech.edu: Solaris
    • www.helsinki.fi: Solaris
    • www.cmu.edu: I could have guessed...
    • www.adti.net: FreeBSD (sigh)
    • www.unix.org: Solaris
    • www.opensource.org: FreeBSD
    • www.xig.com: FreeBSD
    • www.sco.com: Linux (mwahahaha)

    Also see this article at Netcraft. Sure, Linux outnumbers BSD. But that's not the point. I hate to disappoint you all, but BSD is not dying.