bashmacossshkeychainaccess-control-list

`security unlock-keychain` from a bash script


On MacOSX, if I ssh in and run the command:

security -v unlock-keychain -p <password> <keychain_path>

The keychain unlocks and all is well with the world.

If I put that same command into a bash script and run

bash test.sh

I get prompted for the password.

How can I get around this?


Solution

  • You need to explicitly let your script test.sh access your keychain.

    Credits: Running xcodebuild from a forked terminal