Skip to content

Instantly share code, notes, and snippets.

@reelsense
Last active August 4, 2020 02:22
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 reelsense/6f9e295587240c0939e8e829bc8607ab to your computer and use it in GitHub Desktop.
Save reelsense/6f9e295587240c0939e8e829bc8607ab to your computer and use it in GitHub Desktop.
help-gpg-agent

Help Desktop Applications usegpg-agent for Yubikey.

How do I use my Yubikey with desktop applications like Sequel Pro or MySQL Workbench?

When you use the GPG Agent (with or without smartcard, the agent takes care of that, so it's not a problem if you don't have one I think) it should ask for the passphrase of your GPG key (or the PIN of the smartcard in my case) and not the SSH password.

But how it works now is that the SSH attempt asks for the SSH password, not the GPG passphrase.

Ok, here is an example:

Using SSH in the terminal, with the gpg-agent: (I have a smartcard so it asks for my PIN)

It asks for the PIN via the gpg-agent.

When I use Sequel, before, the behavior was exactly the same, I had the PIN entry window then it was connecting well.

Now I have that:

So, it is not asking for the PIN anymore: or even if I had enter it before, it should use the gpg-agent and finish to login. Instead it asks for the SSH user's password.

Let me know if you need more explanation.

Thanks

Solution by @jacquesbh in sequelpro/issue#2619

Create an Automator Application:

source ~/.bash_profile
open -a Sequel\ Pro

My ~/.bash_profile contains this:

## SSH with GPG key on Yubikey
export GPG_TTY="$(tty)"
export SSH_AUTH_SOCK="${HOME}/.gnupg/S.gpg-agent.ssh"
gpgconf --launch gpg-agent
@viteshan
Copy link

viteshan commented Aug 4, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment