Skip to content

Instantly share code, notes, and snippets.

@gtmanfred
Created May 21, 2021 23:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gtmanfred/094a1be6a382bef0ac748619007d4f7f to your computer and use it in GitHub Desktop.
Save gtmanfred/094a1be6a382bef0ac748619007d4f7f to your computer and use it in GitHub Desktop.
Gnupg setup
enable-ssh-support
default-cache-ttl 60
max-cache-ttl 120
pinentry-program /usr/local/bin/pinentry-mac
set -gx AGENT_SOCK (gpgconf --list-dirs | awk -F':' '/agent-socket/ {print $2}')
if not test -S $AGENT_SOCK
gpg-agent --daemon --use-standard-socket
end
set -gx GPG_TTY $TTY
# Set SSH to use gpg-agent if it's enabled
set -gx GNUPGCONFIG "$HOME/.gnupg/gpg-agent.conf"
if test -r $GNUPGCONFIG; and command grep -q enable-ssh-support "$GNUPGCONFIG"
set -gx SSH_AUTH_SOCK "$AGENT_SOCK.ssh"
set -e SSH_AGENT_PID
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment