Advertisement

New command line tools in Mountain Lion manage encryption, sleep and sharing

For fans of the Terminal, Mountain Lion brought some new command-line utilities. Perhaps the most notable is fdesetup, which Apple explains briefly: "fdesetup allows third-party management tools to enable FileVault, determine encryption status, capture and manage recovery keys, and add users to a FileVault-encrypted system as well as synchronize directory-based user authentication credentials with the local credentials for FileVault access."

Apple provides a 'man' page for fdsetup, but if you want more information about it, Rich Trouton at Der Flounder has a very thorough walk-through with a bunch of screenshots and excellent explanations. I'm definitely keeping this one in Pinboard for the inevitable day when I want or need to use fdsetup. I'm also glad to have a more low-level tool for working with FileVault.

I had written previously about the "hoops" which were necessary to disable certain users from being able to unlock the computer with FileVault. That process is now a lot easier.

But wait, there's more!

Patrix over at the Ask Different blog discovered several other new command-line utilities. Some of them are generic Unix utilities (pgrep and pkill) but there are also some OS X specific ones, including:

  • caffeinate – prevent the system from sleeping on behalf of a utility

  • serverinfo – determine server status (is this OS X Server, and, if so, are these things enabled)

  • sharing – create share points for AFP, FTP and SMB services

  • tccutil – manage the privacy database

See the original article for more details. Of these, caffeinate seems like the most interesting. I have used Caffeine, the free app from Lighthead Software, to keep my Mac awake at times, but being able to do it in shell scripts could definitely come in handy.

Still missing your favorite Unix utility?

If Mountain Lion still doesn't have your favorite utility, don't forget you have other options. I have used Rudix when I wanted precompiled binaries, and Homebrew when I want to make my own. Mostly these days I stick with Homebrew, which is regularly updated by a bunch of people, versus Rudix which has a smaller library and seems to be mostly the labor of love of one developer.

Others may prefer Fink or MacPorts; I have used both in the past but haven't kept up with them recently. Both of them appear to have been updated for Mountain Lion.