From 7e3485af3684d3653ec69f865ea0740f413a17f2 Mon Sep 17 00:00:00 2001 From: Joe Block Date: Fri, 6 Nov 2015 10:07:16 -0800 Subject: [PATCH] Add examples for creating encrypted disk images as well --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 3c01d14..3bf9d1e 100644 --- a/README.md +++ b/README.md @@ -303,6 +303,16 @@ sudo fs_usage hdiutil create -volname "Volume Name" -srcfolder /path/to/Folder -ov diskimage.dmg ``` +If you'd like to encrypt the dmg, do: +```bash +hdiutil create -encryption -stdinpass -volname "Volume Name" -srcfolder /path/to/Folder -ov encrypted.dmg +``` + +By default, you'll be prompted for a password, but you can automate that as well by piping in a password: +```bash +echo -n YourPassword | hdiutil create -encryption -stdinpass -volname "Volume Name" -srcfolder /path/to/Folder -ov encrypted.dmg +``` + #### Burn Disk Images to DVD This command applies to .iso, .img and .dmg images. ```bash