I would always like to use the GUI version of entering my GPG passphrase. Currently my pinentry program is set the same on my laptop as my desktop. But the desktop always asks for my passphrase on the command line, and my laptop always asks using the GUI.

What do I need to set to force the use of the GUI on the desktop?

Current ~/.gnupg/gpg-agent.conf

pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac
default-cache-ttl 600
max-cache-ttl 7200

Current ~/.gnupg/gpg.conf

default-key 26A32A76
keyserver-options auto-key-retrieve
keyserver hkps://hkps.pool.sks-keyservers.net
auto-key-locate hkps://hkps.pool.sks-keyservers.net
keyserver-options no-honor-keyserver-url
comment GPG
cert-digest-algo SHA512
default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed
personal-digest-preferences SHA512 SHA384 SHA256 SHA224
  • 8
    Try killing the agent after modifying the config file: gpgconf --kill gpg-agent. On next use the agent will start again.
    – user146607
    Apr 16, 2017 at 9:15

2 Answers 2

  • Try to uncheck Store passphrases in OS X Keychain by default and press Delete stored passphrases button in GPGPreferences if you installed GPG Suite.

  • Also try to comment this line from your ~/.gnupg/gpg.conf:

  • 1
    thank you! I just wanted to opt INTO storing on the keychain, instead of OUT, since I have a master passphrase that I don't want to be filled in automatically for me, but I have other keys which it's okay to do that :) and I don't want to always have to turn off the "Store in Keychain" on pinentry dialogs
    – mike
    May 3, 2018 at 1:00

For those who are struggling with this in 2023:

You can change the pinentry-mode (~/.gnupg/gpg.conf) to ask and you'll always get the GUI prompt to enter the password (unless the passphrase is saved).

This is useful for various IDEs like Intellij.

Config file entry:

# your previous options
pinentry-mode ask
  • 1
    This might just be me, but I had to kill the running gpg-agent process after making this change for it to take effect. (I got its PID via ps aux | grep gpg and then ran kill -9 [PID])
    – jarhill0
    Mar 31 at 23:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .