encrypt file in batch mode

Brian C brianc1969 at gmail.com
Sat Nov 2 22:52:14 CET 2019


I can answer why the passphrase is needed: You are using the -s option
which tells gpg to sign the file, which requires your private key.

Brian

On 11/2/19 11:14 AM, Fourhundred Thecat wrote:
> On 02/11/2019 16.51, Tony Lane via Gnupg-users wrote:
>> On 11/2/19 10:35 AM, Fourhundred Thecat wrote:
>>
>>> how can I simply encrypt a file in "batch mode", ie in a script, without
>>> user interaction, without need for the user to type password, without
>>> gpg agent?
>>
>> gpg --batch --yes --passphrase="pw" --pinentry-mode loopback -o zz -esr user at domain.com zz.gpg
> 
> Unfortunately, this does not work. I get same error as before (pasted
> below).
> 
> Also, what is the purpose of --passphrase="pw", when I want to encrypt
> using public key ?
> 
> 
> $ gpg --batch --yes --passphrase="pw" --pinentry-mode loopback -o zz.gpg
> -esr user at domain.com zz
> 
> gpg: starting migration from earlier GnuPG versions
> gpg: failed to start agent '/usr/bin/gpg-agent': No such file or directory
> gpg: can't connect to the agent: No such file or directory
> gpg: error: GnuPG agent unusable. Please check that a GnuPG agent can be
> started.
> gpg: migration aborted
> gpg: failed to start agent '/usr/bin/gpg-agent': No such file or directory
> gpg: can't connect to the agent: No such file or directory
> gpg: failed to start agent '/usr/bin/gpg-agent': No such file or directory
> gpg: can't connect to the agent: No such file or directory
> gpg: keydb_search failed: No agent running
> gpg: no default secret key: No agent running
> gpg: zz: sign+encrypt failed: No agent running
> 
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20191102/d52bfa4e/attachment.sig>


More information about the Gnupg-users mailing list