Wednesday, August 27, 2008

Command Line: Encrypted DMG's

I came accross this post on macosxhints.com which made me wonder how to create encrypted DMGs from the command line. Turns out it's a no-brainer.


hdiutil create -fs HFS+ -encryption -stdinpass \
-srcfolder SomeFolder -volname VolumeName Encrypted.dmg


The -stdinpass option prompts you for a password for the DMG, reading from standard input (using readpassphrase in a terminal).

Nice.

No comments: