May 23, 2018

Using your yubikey as ssh key provider / Quick(est) guide

I figured it’s time to write up the quickest guide about using the yubikey as the source of your ssh key. This assumes that:

  • You have a yubikey and it’s in your usb port
  • You’ve configured gpg on you machine (I’m running gpg (GnuPG) 2.2.7)
  • You’re using the gpg-agent with enabled ssh support

Here are the steps:

gpg --card-edit
> admin
> generate
> [enter the requested PIN]
> quit

And now you’re done. You can check if the new ssh key get pulled correctly from your yubikey typing:

ssh-add -L

And you should see something like:


Now you can use this key e.g for as your github key and whenever your push/pull/clone you will need to enter the yubikey into your device.

Lukasz Plotnicki © 2021 | Follow on Twitter

Powered by Hugo & Kiss.