From some of the things I've read it seems a Yubikey could be configured as a 2 factor authentication (2FA) device for a GitHub account.
First, the GitHub general help for configuring 2FA is
here. There are two basic ways to configure 2FA, SMS/text message or a TOTP app such as Google Authenticator or perhaps Yubikey. The page which seems more appropriate for setting up a Yubikey is the one which
deals with TOTP.
On the Yubikey documentation side, I found the
Yubico-TOTP-Setup.pdf file listed on
this documentation page..
This PDF from Yubico seems to indicate one can copy secret keys (as text) from sites which display QR codes and enter them into a tool called the
YubiTOTP application. This tool is a Windows executable and obviously can't be readily used on Mac OS X.
However, looking around the
YubiKey Personalization Tool, there are some configuration screens which seem very very similar to those the PDF describes as existing in the YubiTOTP application. For example, things such as selecting an 6-digit or 8-digit OATH code, pasting the secret key displayed by the website into the appropriate field in the tool, and more. But it just doesn't work.
Most of the websites - GitHub too - display a secret key that isn't hex so attempting to paste the key into the YubiKey Personalization Tool doesn't work.
Is there perhaps another way to get this set up? Interestingly, the Yubikey documentation describes a very similar process for setting up 2FA with Google Apps / Gmail via QR codes. But you don't have to do this as Google simply asks you to press a button, plug in your Yubikey, then press the button on the Yubikey to generate a one-time password. Could not something similar be done on GitHub?
I'd love to set up GitHub with my Yubikey as a 2FA device but there doesn't appear to be a way to do this without the Windows app.