GH-900 ยท Security and administration
Two-factor authentication and passkeys
Why 2FA matters, 2FA methods (authenticator app, security key, SMS), recovery codes, and passkeys as phishing-resistant sign-in.
Key points
- 2FA adds a second proof of identity to your password, so a stolen password alone is not enough.
- Methods: authenticator app (time-based codes), security key (hardware or built-in like Windows Hello), and SMS codes.
- Save your recovery codes, because support cannot restore a 2FA account for you.
- A passkey can replace the password and 2FA with one phishing-resistant step; keep a fallback method.
Practice questions
What is the main security benefit of enabling two-factor authentication on a GitHub account?
- A stolen password alone is no longer enough to sign in
- All repositories on the account become private
- Commits are automatically encrypted at rest
- The account can no longer be deleted by anyone
Show answer
Answer: A. A stolen password alone is no longer enough to sign in
2FA requires a second factor beyond the password, so a leaked password alone does not grant access. It does not encrypt your code or hide your repositories.
Which of the following can be used as a second factor or sign-in method on GitHub?
- Authenticator app with time-based codes
- Security key
- Passkey
- Browser bookmark of the login page
- Your public SSH key pasted in the login form
Show answer
Answer: A. Authenticator app with time-based codes, B. Security key, C. Passkey
Authenticator apps and security keys are supported, and passkeys can sign you in. A browser bookmark and a public SSH key are not authentication factors for the web sign-in.
True or false: if you lose your 2FA device and recovery codes, GitHub Support can always simply restore access to your account.
Show answer
Answer: False
False. GitHub warns that support cannot restore access to accounts with 2FA enabled when credentials and recovery methods are lost, which is why saving recovery codes matters.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
