Categories
Linux Mastering Development

How can I generate gpg keys in scripts without leaving gpg-agent running?

Recent versions of gpg launch a persistent user process (gpg-agent) when generating keys. This process remains running even after the command terminates. I want to change this behavior. Currently, I’m using unshare and PID namespaces to isolate and kill off anything that gpg leaves running. Unfortunately, this approach requires elevated privileges that may not always […]