Skip to content

Instantly share code, notes, and snippets.

@aaronjanse
Created August 21, 2017 14:37
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronjanse/049e913029c282508934fbfae48a7d7d to your computer and use it in GitHub Desktop.
Save aaronjanse/049e913029c282508934fbfae48a7d7d to your computer and use it in GitHub Desktop.
Magical command to make gpg work with YubiKey smartcard

Fixed most problems such as:

gpg: agent_genkey failed: No pinentry
Key generation failed: No pinentry
gpg-agent[339]: smartcard signing failed: Inappropriate ioctl for device
gpg-agent[339]: command 'PKSIGN' failed: Inappropriate ioctl for device <Pinentry>
qgpg-agent[339]: DBG: no device present

Credits go to @DomT4 https://github.com/Homebrew/homebrew-versions/issues/681#issuecomment-77455942

killall gpg-agent && gpg-agent --daemon --use-standard-socket --pinentry-program /usr/local/bin/pinentry
@zhangyoufu
Copy link

/usr/local/bin/pinentry does not work well for me. It appears on wrong tty, and key input was interfered.

brew install pinentry-mac and set pinentry-program /usr/local/bin/pinentry-mac in ~/.gnupg/gpg-agent.conf works well for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment