<div dir="ltr"><div>I want:</div><div><br></div><div>To be able to configure an Ubuntu Xenial machine with passphrase-protected gpg2 keys on disk, and have a running gpg-agent with a passphrase for the keys pre-loaded by a script. "Users" of this environment should never see a gpg passphrase prompt: the script will have been run and will have populated the gpg-agent with the passphrase for the keys before they run a single command.</div><div><br></div><div>I'd settle for getting it working with vanilla gpg2, but ultimately I want git to be able to sign commits.</div><div><br></div><div>I've had a hard time tracking down online documentation that speaks specifically to gpg 2.1+; most of what I've found (on the stackexchange sites, forums, and mailing lists, etc) reference older versions of gpg, especially where gpg-agent is concerned.</div><div><br></div><div>I execute gpg-preset-passphrase to the best of my understanding, but all GPG tools still prompt me for a passphrase. After entering the passphrase, the gpg-agent correctly saves it and I avoid any future prompts.</div><div><br></div><div>I suspect that one of the following is true:</div><div><br></div><div>1. I don't know how to use gpg-preset-passphrase 2.1.11</div><div>2. gpg-preset-passphrase 2.1.11 doesn't work with gpg-agent 2.1.11</div><div>3. gpg-preset-passphrase 2.1.11 doesn't work in Ubuntu Xenial</div><div><br></div><div>To aid in debugging, I have created a git repository that builds an Ubuntu Xenial Docker image that reproduces the issue. Really it just does what I am trying to do, in the environment I was trying to do it in, and fails the same way.</div><div><br></div><div>So, while I'll quickly tell you some relevant things about my environment, e.g.</div><div><br></div><div>1. OS: Ubuntu 16.04.5 LTS</div><div>2. gpg2 version: gpg (GnuPG) 2.1.11</div><div>3. gpg-agent version: gpg-agent (GnuPG) 2.1.11</div><div>4. gpg-preset-passphrase version: gpg-preset-passphrase (GnuPG) 2.1.11</div><div><br></div><div>You can (if you have "docker" installed), visit & clone <a href="https://github.com/Gengar003/linux-gpg2-agent-preset">https://github.com/Gengar003/linux-gpg2-agent-preset</a> to reproduce & explore my situation in my exact environment with my exact commands. </div><div><br></div><div>My actual questions are:</div><div><br></div><div>1. Am I using gpg-agent correctly for gpg 2.1+?</div><div>2. Am I using gpg-preset-passphrase correctly for gpg 2.1+?</div><div>3. Should gpg-preset-passphrase work with gpg 2.1+?</div><div>4. Does anyone know of a working example of a preset passphrase with gpg-agent in gpg 2.1+?</div><div><br></div><div>Thank you for your time.</div></div>