Allen Pomeroy

Blog of an IT security specialist .: beta :.

Mac OS X 10.5 Command Line notes

Tags: ,

Encrypted Filesystems with Sparse Bundles
Mac OS X offers encrypted filesystems through sparse bundles.  To mount up a sparse bundle, given the password used to create the bundle, use the hdiutil:

hdiutil attach -verbose -readonly /path/to/sparse.bundle.directory

This will mount up the sparse bundle located at the directory path specified.  To unmount the sparse bundle, use:

hdiutil detach /Volume/sparse.bundle.name

Adding entries to /etc/hosts
Although simply editing /etc/hosts should work, there are times where the new entries may not be recognized, in these cases the OS X name cache daemon needs to be kicked:

dscacheutil -flushcache

Mac OS X Hostnames
Although you can change the hostname of your Mac OS X device through the System Control Panel -> Sharing, the following command line can lock the name so DHCP and other dynamic networking protocols don’t mess up your hostname (from RichardBronosky):

sudo hostname my-permanent-name

sudo scutil –set LocalHostName $(hostname)

sudo scutil –set HostName $(hostname)

© 2009 Allen Pomeroy. All Rights Reserved. This is the personal website of Allen Pomeroy. Opinions expressed are not necessarily those of my employer.