Can't get gnupg to work: no pinentry

for those who want a quick fix. Eg you need to create a key before pushing a small change on github from a bootable flash.

You can disable pin entry

  1. create a config file : ~/.gnupg/gpg.conf
  2. Add these 2 lines to the config file:
  • use-agent
  • allow-loopback-pinentry
  1. run the key generation using the --pinentry-mode flag as shown below

gpg --full-generate-key --pinentry-mode loopback

This is with the assumption that part of your nixos config file looks like this :

  services.pcscd.enable = true;
  programs.gnupg.agent = {
   enable = true;
   enableSSHSupport = true;
  };

1 Like