Stop popup which asks for the passphrase

Peter Lebbing peter at
Tue Apr 2 13:12:23 CEST 2019

Hello Shweta,

> gpg --batch --passphrase-fd n and it stops popup which asks for the
> passphrase. but when I run this command on window server 12 it's not
> working its always show popup for the passphrase.

It is not clear to me which versions of GnuPG you are using. Using a
recent version, but on Linux, I cannot reproduce that this command
works, so I agree with Windows there.

What works for me is:

$ gpg --batch --pinentry-mode loopback --passphrase-fd n [...]

(obviously filling in a number for n, and continuing with more options
and a command for gpg).

With older versions of gpg-agent, it might be necessary to specify the
following in ~/.gnupg/gpg-agent.conf (rather, its location on your OS of


but this is the default now.

As a full working example, this works for me:

$ echo Hi | gpg --batch -o test.gpg -u 1819B624D400781C8988105EC97A5BCE0BFBF628 --passphrase-fd 3 --pinentry-mode loopback -s 3<<<test

Yes, the literal password for this key is "test"; it is, after all, a
test key.

If this is not enough to help you, please specify which versions of
GnuPG you are running on which operating systems, and the contents of
the various .conf files for GnuPG, and most importantly: actual command
lines and their actual output. You can edit out confidential data, but
it really helps if we can see the actual interaction with gpg to
pinpoint the culprit.

Furthermore, I myself have hardly any knowledge of Microsoft Windows, so
someone else might need to fill that void.



I use the GNU Privacy Guard (GnuPG) in combination with Enigmail.
You can send me encrypted mail if you want some privacy.
My key is available at <>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the Gnupg-users mailing list