hdiutil prompting for password

Discussion in 'macOS' started by dilig0, Sep 11, 2010.

  1. dilig0 macrumors newbie

    Sep 11, 2010
    I need to use hdiutil create command line to create .dmg within a script.
    A popup asks me to enter my password.

    I would like to skip this step which breaks the execution of the script and automation of the dmg generation.

    How to skip the password prompting or pre-enter my password so that the script can execute without any action from any user.

  2. Hal Itosis macrumors 6502a

    Hal Itosis

    Feb 20, 2010
    As per the man page... we use the -stdinpass option, and pipe the text string into the command itself:

    printf '
    passwordGoesHere' |hdiutil create -encryption -stdinpass <other options> nameOfImage.dmg


Share This Page