hdiutil prompting for password

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

  1. dilig0 macrumors newbie

    Joined:
    Sep 11, 2010
    #1
    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.

    Thanks
     
  2. Hal Itosis macrumors 6502a

    Hal Itosis

    Joined:
    Feb 20, 2010
    #2
    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