How to get your GitHub 2FA setup key
GitHub shows a QR code when you enable two-factor authentication. The text version of the secret is behind the “setup key” link just below it.
Steps
- On GitHub, select your profile picture in the top-right corner, then Settings.
- In the sidebar, choose Password and authentication.
- Under “Two-factor authentication”, choose Enable two-factor authentication and pick the authenticator app option. GitHub shows a QR code.
- Either scan the QR code with Quick2FA, or choose the setup key link to see the key as text and paste it into Quick2FA.
- Type the 6-digit code from Quick2FA into GitHub to verify.
- Download your recovery codes when GitHub offers them, and keep them somewhere safe.
Menu names change from time to time. If a label is different, look for the closest match in your account settings.
Good to know
- If two-factor authentication is already on, the same page lets you edit the authenticator app, which issues a new key and retires the old one.
- GitHub cannot restore access to an account that has lost both its authenticator and its recovery codes, so do not skip the recovery codes.
If GitHub rejects the code
Check that your device clock is set automatically, that you copied the whole key, and that you entered the code before the countdown ended.