by usea · 3y ago · 0 comments
Pick TOTP as your 2FA method and save the TOTP secret, which you can get on the TOTP setup page at Github by clicking the thing that says you want to use a text code instead of scanning a QR code.
It will give you a short text string. Save that string.
When you need the TOTP code for Github, use oathtool [1] or something similar. For oathtool:
oathtool --totp -b <aforementioned_string>
will give you the current TOTP code. The -b flag tells it the code is in base32. I think that is what Gitgub uses. If they use hex omit -b.There are numerous devices you can use for TOTP 2FA, your computer, a hardware device and even your browser via authn.