Here's info on the pass: https://www.passwordstore.org
My key point is, that I would like to pass the passphrase key at the command line. However, the topic and solutions related to this question that I could find, are not working in my case.
When I have examined the code of Pass, I have found a parameter called PASSWORD_STORE_GPG_OPTS. As far as I can see, it should be possible to use it to pass --pinentry-mode=loopback --passphrase "<password_here>" to gpg executed by Pass. The code fragment that executes it is here:
#Line 9
GPG_OPTS=( $PASSWORD_STORE_GPG_OPTS "--quiet" "--yes" "--compress-algo=none" "--no-encrypt-to" )
#(...)
#Line 387
pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | $BASE64)" || exit $?
However, for some reason, this is not working.
So the question is, would it be possible to use this parameter to pass passphrase to gpg and use pass without prompt? If not, then are there any other ways to do so?
EDIT: As @they suggested, here is info on what I'm doing:
Set variable:
export PASSWORD_STORE_GPG_OPTS="--pinentry-mode=loopback --passphrase '<password_goes_here>'"
Remark: Password contains only small and big letters and digits - no whitespaces nor other characters.
Then, execute the pass with:
pass address/to/some/password
Outcome is:
gpg: decryption failed: No secret key
pass
manual. It can only be used if the value can be split on whitespaces and undergo filename globbing and still be a valid set of arguments togpg
. This means that if your password contains filename globbing character and spaces/tabs, then you will have issues. It's not clear from the question what you actual issue is, so I'm not turning this into an answer. The answer to "does not work" is just "you did something wrong".pass
, and the actual output from doing so. Don't show your password, but say whether it contains spaces, tabs, or newlines, or filename globbing characters like*
,[
,]
, and?
.