Two-Factor Authentication Cheat Sheet

Last Updated: November 21, 2025

What is 2FA?

Concept Explanation
Definition Second layer of security beyond password. Requires something you know (password) + something you have (phone/key)
Why Use It Protects against password theft, phishing, data breaches. Even if password is stolen, attacker can't access account
How It Works After entering password, you provide a second form of verification: code from app, SMS, hardware key, or biometric
Also Called Two-step verification, 2SV, multi-factor authentication (MFA), two-step authentication
Security Increase Blocks 99.9% of automated attacks according to Microsoft research

2FA Method Comparison

Method Security Convenience Pros Cons
Authenticator App (TOTP) High High Works offline, free, secure, multiple accounts Lose phone = locked out (use backup codes)
Hardware Key (FIDO2/U2F) Highest Medium Phishing-proof, most secure, no batteries Cost ($25-70), can lose, not universally supported
SMS Text Code Low-Medium High Easy, no app needed, familiar SIM swapping risk, cell service required, phishing possible
Email Code Low-Medium Medium No phone needed, accessible anywhere Only as secure as email account, slower
Push Notification Medium-High Very High One tap approval, user-friendly Internet required, push fatigue risk
Backup Codes Medium Low Works when primary method fails Single use, must store securely, easy to lose
Biometric (Passkeys) High Very High Fast, phishing-proof, no codes to type Limited support, device-dependent

Authenticator App Comparison

App Platform Backup Key Features
Authy iOS, Android, Desktop Cloud backup (encrypted) Multi-device sync, cloud backup, desktop apps, trusted devices
Google Authenticator iOS, Android Cloud backup (Google account) Simple, Google account sync, QR code transfer to new device
Microsoft Authenticator iOS, Android Cloud backup (Microsoft account) Passwordless sign-in, autofill, cloud backup, enterprise features
1Password All platforms Encrypted sync Integrated with password manager, automatic sync, secure vault
Bitwarden Authenticator All platforms Encrypted sync Open source, integrated with password manager, cross-platform
2FAS iOS, Android Cloud backup (encrypted) Free, open source, cloud backup, browser extension, icon packs
Duo Mobile iOS, Android No cloud backup Push notifications, trusted devices, enterprise-focused
Aegis (Android) Android only Encrypted local/cloud export Open source, encrypted backups, customizable, no account needed
Raivo OTP (iOS) iOS only iCloud encrypted backup Open source, iCloud sync, offline, clean interface

Google Account Setup

Step Instructions
1. Access Security Go to myaccount.google.com → Security
2. 2-Step Verification Scroll to "How you sign in" → Click "2-Step Verification"
3. Get Started Click "Get Started" button
4. Sign In Enter your Google password to confirm
5. Phone Number Enter phone number for SMS/call verification (initial setup)
6. Verify Phone Enter code sent to your phone
7. Turn On Click "Turn On" to enable 2-Step Verification
8. Add Authenticator Security → 2-Step → Authenticator app → Choose phone type → Scan QR code
9. Verify App Enter 6-digit code from authenticator app
10. Backup Codes 2-Step Verification → Backup codes → Generate & save 10 codes
11. Optional: Security Key 2-Step → Security key → Add USB/NFC key (YubiKey, etc.)
12. Trusted Devices Check box "Don't ask again on this device" on trusted computers

Apple ID Setup

Step Instructions
1. Settings iPhone/iPad: Settings → [Your Name] → Password & Security
2. Enable 2FA Tap "Turn On Two-Factor Authentication"
3. Continue Tap "Continue" on the prompt
4. Trusted Number Enter phone number to receive verification codes (SMS or call)
5. Verify Number Enter 6-digit code sent to phone
6. Auto-Enabled 2FA now active - codes sent to trusted devices automatically
7. Trusted Devices Other Apple devices (Mac, iPad) auto-receive codes via notification
8. Recovery Key (Optional) Settings → Password & Security → Recovery Key → Generate (store safely!)
Mac Setup System Settings → Apple ID → Password & Security → Turn On Two-Factor Authentication
Legacy Contact Settings → [Name] → Password & Security → Legacy Contact → Add someone to access after death

Microsoft Account Setup

Step Instructions
1. Account Security Go to account.microsoft.com → Security
2. Advanced Security Click "Advanced security options"
3. Two-Step Verification Under "Two-step verification" → Click "Turn on"
4. Choose Method Select: Authenticator app (recommended), Phone, or Email
5. Authenticator App Download Microsoft Authenticator → Scan QR code → Enter code
6. Phone Option Enter phone number → Choose SMS or call → Enter verification code
7. Backup Info Add alternate email or phone for account recovery
8. Finish Setup Click "Finish" to complete setup
9. Recovery Code Security → Advanced → Recovery code → Generate & save
10. App Passwords For older apps (Outlook 2013, etc.): Security → App passwords → Generate

GitHub Setup

Step Instructions
1. Settings Click profile picture → Settings
2. Account Security Left sidebar → Password and authentication
3. Enable 2FA Two-factor authentication → Click "Enable two-factor authentication"
4. Authenticator App Choose "Set up using an app" (recommended)
5. Scan QR Code Open authenticator app → Scan QR code shown on GitHub
6. Enter Code Type 6-digit code from app to verify
7. Download Recovery Codes Download or print recovery codes (16 codes) - VERY IMPORTANT
8. Store Codes Save codes in password manager or secure location
9. Optional: SMS Fallback Add phone number as backup method
10. Security Keys Add hardware security key (YubiKey): Settings → Security keys → Register new

Social Media 2FA Setup

Platform Path to Settings Recommended Method
Facebook Settings → Security and Login → Two-Factor Authentication → Edit Authenticator app or security key
Instagram Settings → Security → Two-Factor Authentication Authenticator app (WhatsApp or authentication app)
Twitter/X Settings → Security and account access → Security → Two-factor authentication Authenticator app (free) or SMS (paid users only)
LinkedIn Settings → Account → Two-step verification Authenticator app or SMS
TikTok Settings → Security → 2-step verification SMS or email (no authenticator app support)
Discord User Settings → My Account → Enable Two-Factor Auth Authenticator app required, save backup codes!
Snapchat Settings → Two-Factor Authentication SMS or authenticator app
Reddit Settings → Safety & Privacy → Advanced security → Use two-factor authentication Authenticator app
WhatsApp Settings → Account → Two-step verification 6-digit PIN (different from standard 2FA)
Telegram Settings → Privacy and Security → Two-Step Verification Password + recovery email

Other Important Services

Service Path Notes
Amazon Account → Login & security → Two-Step Verification → Add Authenticator app or SMS
PayPal Settings → Security → 2-step verification → Activate SMS or security key
Dropbox Settings → Security → Two-step verification → Enable Authenticator app or SMS
Slack Settings → Authentication → Two-Factor Authentication Authenticator app, save backup codes
Zoom Profile → Security → Two-Factor Authentication → Enable Authenticator app or SMS
Adobe Account → Security & Privacy → Two-step verification → Turn on Authenticator app
Netflix Account → Security → Require a verification code → Enable SMS or email (basic implementation)
Steam Account Details → Manage Steam Guard → Get codes from app Steam Mobile App required
Epic Games Account → Password & Security → Two-Factor Authentication → Enable Authenticator app or email
Coinbase Settings → Security → 2-step verification Authenticator app REQUIRED for crypto security

Hardware Security Keys

Key Price Protocols Best For
YubiKey 5 NFC $55 USB-A + NFC, FIDO2, U2F, TOTP, PIV Most versatile, works with computers and phones
YubiKey 5C NFC $60 USB-C + NFC, FIDO2, U2F, TOTP, PIV Modern devices (MacBook, new phones)
YubiKey 5Ci $75 USB-C + Lightning, FIDO2, U2F, TOTP iPhone users (pre-USB-C iPhones)
YubiKey Security Key $29 USB-A + NFC, FIDO2, U2F only Budget option, basic 2FA only
Google Titan Key $30 USB-A/C + NFC, FIDO2, U2F Google ecosystem, good budget option
Thetis FIDO2 $30 USB-A + NFC, FIDO2, U2F Budget alternative to YubiKey
OnlyKey $56 USB-A, FIDO2, password manager Advanced users, stores passwords

Backup & Recovery Methods

Method How To When To Use
Backup Codes Download/print 8-16 one-time codes when setting up 2FA Lost phone, no access to authenticator
Multiple Devices Add authenticator app to tablet, second phone, smart watch Phone lost/broken, instant backup
Recovery Email Add verified alternate email to account Can't access primary auth method
Recovery Phone Add alternate phone number SMS backup when app unavailable
Security Questions Set up account recovery questions (where offered) Last resort recovery
Trusted Contacts Facebook, Google: Add trusted friend for recovery Complete account lockout
Print QR Codes Save 2FA setup QR codes when adding accounts Re-add accounts to new phone quickly
Cloud Backup Use Authy, Google, Microsoft Authenticator cloud sync Automatic recovery on new device
Password Manager Store TOTP secrets in 1Password, Bitwarden Access codes from any device
Multiple Security Keys Register 2-3 YubiKeys per account One lost/broken, others still work

Best Practices

Practice Why It Matters
Use authenticator app over SMS SMS vulnerable to SIM swapping and interception. Apps more secure
Save backup codes immediately Store in password manager or print and keep in safe place
Enable 2FA on email first Email is recovery method for other accounts - protect it first
Use hardware keys for high-value Bank, crypto, primary email should use YubiKey if possible
Don't use same phone for SMS + app If phone stolen, both factors compromised. Use separate device or key
Never share codes/keys No legitimate service will ask for your 2FA code. Always a scam
Review authorized apps regularly Revoke access to unused third-party apps in account settings
Enable on these first Email, banking, password manager, social media, work accounts
Store backup codes offline Print or write down - digital backups can be hacked
Test backup methods Before you need them! Verify recovery codes work
Use unique passwords + 2FA 2FA doesn't help if password is reused and leaked elsewhere
Beware "2FA fatigue" attacks Attackers spam push notifications hoping you approve by mistake

Common Issues & Solutions

Problem Solution
Lost phone with authenticator Use backup codes → Add authenticator to new phone → Regenerate backup codes
Authenticator codes not working Check device time sync (Settings → Date & Time → Auto). Must match exactly
Can't receive SMS codes Check signal, airplane mode off. Try voice call option. Use authenticator app instead
Locked out of account Use backup codes → Contact support with ID verification → Recovery email/phone
Getting new phone BEFORE wiping: Transfer accounts (Google Auth QR transfer, Authy sync, or re-add with QR codes)
Security key not recognized Try different USB port, check browser compatibility (Chrome best), update key firmware
Too many 2FA prompts Mark device as trusted (checkbox during login). Use security key for passwordless
App says "Invalid code" Time sync issue - go to app settings → Time correction for codes → Sync now
Backup codes used up Log in with working method → Account security → Generate new backup codes
Changed phone number Update in account settings BEFORE number deactivates. Add new, verify, remove old

What If You're Locked Out

Service Recovery Process
Google Account recovery → Answer security questions → Recovery email/phone → Wait 1-3 days for review
Apple iforgot.apple.com → Account recovery → Can take several days. Use recovery key if set up
Microsoft Recovery code (if you saved it) → Account recovery form → Verification via email/SMS
GitHub Use recovery codes (no other option!) → If lost, must create new account
Facebook Trusted contacts can help → ID verification → Submit appeal to Facebook
Twitter Recovery email/phone → Support ticket with ID verification → Can take weeks
Banking Call customer service → Verify identity (SSN, account details) → In-person visit may be required
Crypto Exchanges VERY DIFFICULT - Some require video verification, ID, selfie. Can lose access to funds

SMS vs App vs Hardware

Factor SMS Authenticator App Hardware Key
Security Level Medium (SIM swap risk) High (offline, encrypted) Highest (phishing-proof)
Convenience High (everyone has phone) High (one device) Medium (carry key)
Works Offline No (needs cell signal) Yes (generates locally) Yes (no battery needed)
Cost Free (may have SMS fees) Free $25-75 per key
Setup Difficulty Easy (type number) Easy (scan QR code) Medium (register key)
Backup/Recovery Change number in settings Cloud sync or backup codes Register multiple keys
Vulnerability SIM swapping, phishing Malware (rare), device theft Physical theft (rare)
Best For Better than nothing Most accounts, daily use High-value: banking, crypto
💡 Pro Tips:
  • Enable 2FA on your email account FIRST - it's the recovery method for everything else
  • Buy TWO hardware keys (YubiKey) and register both - keep one as backup in safe place
  • Use Authy instead of Google Authenticator for automatic cloud backup of your codes
  • Print backup codes and store with important documents - digital backups can be hacked
  • Screenshot or save QR codes when setting up 2FA for easy re-setup on new device
  • For maximum security: Use different 2FA methods for different account types (keys for banking, app for social)
  • Set phone time to auto-sync - authenticator codes won't work if time is wrong
  • Test your backup codes once before you need them to ensure they work
  • Never approve 2FA push notifications you didn't request - report to service immediately
  • Use password manager with TOTP support (1Password, Bitwarden) - backup + convenience
  • For crypto and financial accounts: Hardware key is non-negotiable for serious security
  • Add recovery email/phone BEFORE you need it - can't add when locked out
← Back to Programming Languages | Browse all categories | View all cheat sheets