Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Configure ssh-agent emulation in gpg-agent

Install gnupg

brew install gnupg brew install pinentry-mac

Make sure you have gpg 2.1.20 or better

gpg --version gpg (GnuPG) 2.1.20 libgcrypt 1.7.6 Copyright (C) 2017 Free Software Foundation, Inc.

.bashrc or similar

gpgconf --launch gpg-agent export GPG_TTY=$(tty) export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)

.gnupg/gpg-agent.conf

enable-ssh-support pinentry-program /usr/local/bin/pinentry-mac

Find keygrip of your authentication key (A)

gpg --list-secret-keys --with-keygrip

sec rsa4096 2015-11-16 [SC] 02064FE662CC40719EE8B5D287773A4099242559 Keygrip = B5A9ABC2111E2BC82F4CC3F98EB83498B54C8A27 uid [ultimate] Stefan Magnus Landrø stefan.landro@gmail.com uid [ultimate] Stefan Magnus Landrø stefan.landro@bekk.no ssb rsa4096 2015-11-16 [E] Keygrip = 97709BC2DA4F62F886642B7CC0962C0C16C928BB ssb rsa4096 2017-03-29 [A] Keygrip = 0B070A3598334830226FE91B930ABA325624CFF1

Add keygrip of authentication key to sshcontrol .gnupg/sshcontrol

Remember newline at end of file!

Export ssh key from gpg

gpg --export-ssh-key 02064FE662CC40719EE8B5D287773A4099242559

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.