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?
You need to explicitly let your script test.sh
access your keychain.