Skip to main content
Two-factor authentication (2FA) adds an essential second verification step beyond username and password. Requiring 2FA for organization members, outside collaborators, and billing managers reduces account-takeover risk and is an important part of any GitHub security posture. Before enforcing 2FA across an enterprise, understand the three primary 2FA methods GitHub supports and their trade-offs.
  • Security keys (highest security)
  • Time-based one-time password (TOTP) apps (recommended for most users)
  • SMS (deprecated; last resort)

2FA methods and recommendations

First, the most secure option is security keys: physical USB or NFC devices (for example, YubiKeys) that provide strong phishing resistance. In high-security enterprise environments, FIDO2 hardware keys are the gold standard. Second, time-based one-time password (TOTP) applications generate codes locally on a device. Examples include Google Authenticator, Authy, and 1Password. GitHub recommends TOTP apps for most users because they work offline, generate codes locally, and can support backups.
A presentation slide about TOTP (time-based one-time passwords) showing a phone screen with a six-digit code and a progress circle. It lists GitHub's recommended authenticator apps: Google Authenticator, Authy, and 1Password.
Finally, SMS (text message) 2FA is the least secure and GitHub has deprecated it for new two-factor setups. SMS-based 2FA is being phased out and should be used only as a last resort when TOTP apps or security keys are not viable.
A slide labeled "3 – SMS" showing a smartphone graphic stamped "DEPRECATED" and the text "The least secure method," noting SMS is being phased out and should be a last resort when TOTP apps aren't viable.
Security keys provide the strongest protection against phishing. For most users and teams, TOTP apps balance security and usability. Treat SMS as deprecated and only allow it temporarily for users who cannot use the other options.

How enterprise-level enforcement works (and why it can be disruptive)

At the enterprise level, GitHub provides a single toggle to “Require two-factor authentication” for everyone across the enterprise. Conceptually simple, the practical effect is immediate and strict: when enabled, GitHub evaluates every account’s 2FA status and automatically removes any user without an active 2FA method from every organization in the enterprise. This removal applies to humans and bot/service accounts alike. There is no automatic grace period or warning from GitHub.
A slide titled "One Simple, Dangerous Switch" showing a green toggle labeled "Require two-factor authentication for everyone" with a flow diagram below that says "simple as a concept" → "never without a proper runbook" → "dangerous as an operation" and a warning icon.
Enabling enterprise-wide 2FA enforcement will immediately remove non-compliant users (including bots) from organizations — without notification or grace period. Plan, audit, and communicate before you flip the switch.

Operational guidance — audit, communicate, then enforce

Treat enforcement as an operational change that requires a runbook. The recommended sequence is:
  1. Audit
    • For each organization, open the People tab and filter by two-factor authentication status.
    • Export the CSV of users without 2FA.
    • Identify which accounts are human, contractor, outside collaborator, or service/bot.
  2. Cross-check
    • Compare the exported list against your active employee directory and any inventory of service/bot accounts (CI/CD, automation, deploy keys, etc.).
    • Flag critical accounts that need assisted onboarding to 2FA.
  3. Communicate
    • Notify affected users with clear instructions for enabling 2FA (security keys or a TOTP app).
    • Publish a remediation runbook: step-by-step guides, supported authenticators, helpdesk contacts, and a defined compliance window (commonly 7–14 days).
  4. Enforce
    • After the compliance window and verified remediation, enable enterprise-level enforcement.
    • Monitor and verify that no critical service accounts were removed. Re-invite or re-add only after confirming 2FA is configured.
Exporting and cross-referencing users ahead of time reduces the chance of accidentally removing active developers or essential service accounts that require additional coordination.
A slide titled "Audit First, Enforce Second" showing a two-step audit→enforce workflow. It includes a mock GitHub "People" page highlighting users with 2FA disabled and action items like exporting a CSV, cross-referencing the employee directory, sending mandatory notices, and running enforcement after 14 days.

Quick comparison: 2FA methods

Checklist before enabling enterprise 2FA enforcement

  • Audit all organizations and export lists of users without 2FA.
  • Identify and prepare service/bot accounts; update automation to use personal access tokens or machine users with 2FA where appropriate.
  • Communicate timelines, instructions, and help resources to all stakeholders.
  • Provide an internal help channel and assisted enrollment for users who need it.
  • Schedule enforcement after the compliance window and confirm remediation for flagged accounts.
Analogy: enabling enterprise 2FA enforcement is like introducing a strict bouncer at a club — if you don’t notify patrons in advance, regulars will be turned away and chaos will follow. Communicate early, give time to comply, then enforce. Remember: prefer security keys and TOTP apps; treat SMS as deprecated and only use it as a last resort during transitions.

Watch Video