From cc71d9cad6fe60fb3e3ad2f9d84e9f733ad097c6 Mon Sep 17 00:00:00 2001 From: pablu Date: Sat, 19 Sep 2026 00:34:38 +0200 Subject: use gnupg as ssh-agent --- dot_gnupg/private_gpg-agent.conf | 9 +++++++++ dot_zshrc.tmpl | 6 ++++++ 2 files changed, 15 insertions(+) create mode 100644 dot_gnupg/private_gpg-agent.conf diff --git a/dot_gnupg/private_gpg-agent.conf b/dot_gnupg/private_gpg-agent.conf new file mode 100644 index 0000000..888afb5 --- /dev/null +++ b/dot_gnupg/private_gpg-agent.conf @@ -0,0 +1,9 @@ +# Use gpg-agent as the single persistent SSH authentication agent. +enable-ssh-support + +# Cache SSH-key passphrases for a working day, but require them again at +# least once every 24 hours. +default-cache-ttl-ssh 28800 +max-cache-ttl-ssh 86400 + +pinentry-program /usr/bin/pinentry diff --git a/dot_zshrc.tmpl b/dot_zshrc.tmpl index 7ca280e..489b539 100644 --- a/dot_zshrc.tmpl +++ b/dot_zshrc.tmpl @@ -47,6 +47,12 @@ alias ls='eza --icons=always' {{ if eq .chezmoi.hostname "gentoo" }} +unset SSH_AGENT_PID +export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" +export GPG_TTY="$(tty)" +gpgconf --launch gpg-agent +gpg-connect-agent updatestartuptty /bye >/dev/null + eval "$(mise activate zsh)" [[ -r ~/.config/secrets/openrouter.env ]] && source ~/.config/secrets/openrouter.env -- cgit 1.3.1