Sample Header Ad - 728x90

gpg2 pinentry fails without X

1 vote
2 answers
2062 views
**What is working** My gpg-agent pinentry works fine under X. I can run echo "test" | gpg2 -ase --default-recipient-self | gpg2 to cache my passwords and later run killall gpg-agent -1 to flush them. By default, it opens pinentry-gtk (from the looks of it) and prompts me for my password. **What is not working** However, if I try to run the same command without an X server, the it appears that gpg2 is hanging (no prompt or anything). If I kill it, then I can see that there is also a pinentry process which continues to exist but not anywhere useful. **What I expect to happen** I expect that running gpg2 without an X server would give me a pinentry-curses prompt, the same way that pass does. Additionally, I seem to remember that with older version of gpg, it just prompted me for my password from stdin, and I'm not quite sure why that doesn't happen either. **What I have tried** I have tried the following "fixes" but none have caused the aforementioned command to execute properly. In fact, forcing pinentry-curses causes the aforementioned command to fail even with the X environment (pass still works). - Setting pinentry-program /usr/bin/pinentry-curses in gpg-agent.conf` - Starting gpg-agent like this: gpg-agent --daemon --keep-tty --use-standard-socket --pinentry-program=/usr/bin/pinentry-curses - using an environment variable: export PINENTRY_USER_DATA="USE_CURSES=1” *Background info* I have a nearly empty .gpg-agent config file; all it has is cache timeouts. I am calling gpg-agent directly upon login like eval $(gpg-agent --daemon). I am not booting into X so I use getty to log in.
Asked by rexroni (1668 rep)
Dec 13, 2016, 02:03 PM
Last activity: Sep 18, 2019, 05:25 PM