HOWTO: Disable GPG agent password dialog (pinentry)
Say you want to symmetrically encrypt a file with GPG:
You have already decided on a nice long passphrase and have it copied to the keyboard, when a dialog window pops up asking for the passphrase, but won't allow it to be pasted in.
The fix is simple:
- Open ~/.gnupg/gpg.conf in your favorite editor
- Comment the use-agent line (prefix it with #)
- Kill off the gpg-agent service (sudo killall -9 gpg-agent)
Now you will be prompted at the shell for the passphrase whenever you use gpg -c. This also helps for scripts.
Re: HOWTO: Disable GPG agent password dialog (pinentry)
Thank you! :)
In case others search for this > command where it's useful (non-interactive file encryption via gpg/command line):
gpg --batch --yes --passphrase secret -c file