From 50149205a6c2fc83d413f7260650125fd60aa679 Mon Sep 17 00:00:00 2001 From: Hunt Date: Thu, 12 Jun 2025 10:48:02 -0700 Subject: Fixes for gpg for ssh sessions --- dots/zsh/.config/zsh/setup/gpg.zsh.j2 | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'dots') diff --git a/dots/zsh/.config/zsh/setup/gpg.zsh.j2 b/dots/zsh/.config/zsh/setup/gpg.zsh.j2 index ea5a418..f4c36cb 100755 --- a/dots/zsh/.config/zsh/setup/gpg.zsh.j2 +++ b/dots/zsh/.config/zsh/setup/gpg.zsh.j2 @@ -7,14 +7,13 @@ gpg -k "$KEY_ID" >/dev/null 2>&1 || gpg --import "$HOME/.pubkey" export PINENTRY_USER_DATA="${PINENTRY_USER_DATA:-PINENTRY_USE_TTY}" if [ "$SSH_CLIENT" ]; then export PINENTRY_USER_DATA=PINENTRY_USE_CURSES - exit 0 +else + # yubikey ssh, gpg, and the works! + # https://github.com/drduh/YubiKey-Guide + unset SSH_AGENT_PID + export GPG_TTY=$(tty) + export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + gpgconf --launch gpg-agent + gpg-connect-agent updatestartuptty /bye > /dev/null fi - -# yubikey ssh, gpg, and the works! -# https://github.com/drduh/YubiKey-Guide -unset SSH_AGENT_PID -export GPG_TTY=$(tty) -export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) -gpgconf --launch gpg-agent -gpg-connect-agent updatestartuptty /bye > /dev/null # -- -- -- cgit v1.2.3-70-g09d2