← Back to Blog

How to Enable Passkeys on GitHub (2025 Step-by-Step Guide)

GitHub is where developers store code, and your GitHub account is a gateway to critical infrastructure. Passkeys provide the strongest possible security: passwordless authentication that's phishing-proof and impossible to compromise remotely.

GitHub added passkey support in 2024, and it's now the recommended way to secure your account. This guide walks you through setup in under 5 minutes.

What Are GitHub Passkeys?

Passkeys are a modern replacement for passwords. Instead of typing a password, you authenticate using:

Your actual password never exists. This eliminates password reuse, phishing, and brute-force attacks.

Why Passkeys Matter for Developers

Your GitHub account controls:

If someone hacks your GitHub account, they could steal code, inject malware, or compromise deployed applications. Passkeys prevent this entirely.

Requirements

Step-by-Step: Enable Passkeys on GitHub

Step 1: Log Into GitHub Settings

  1. Go to github.com and log in
  2. Click your profile photo (top right) β†’ "Settings"
  3. In the left menu, click "Password and authentication"
  4. You'll see a section called "Passkeys"

Step 2: Register Your First Passkey

  1. Click "Register a new passkey"
  2. Give your passkey a name (e.g., "iPhone Face ID" or "YubiKey")
  3. Click "Register passkey"
  4. GitHub will prompt you to verify your identity (use your current password or 2FA)

Step 3: Complete Passkey Registration

  1. Your browser will prompt you to create a passkey
  2. Choose your device/method:
    • This device: Uses your phone/computer's biometric
    • A security key: Use a YubiKey or similar
    • Another device: Use your phone to scan a QR code
  3. Follow the biometric prompt (Face ID, fingerprint, PIN, etc.)
  4. GitHub will confirm the passkey was registered
πŸ’‘ Pro tip: Register at least 2 passkeysβ€”one on your main device and one backup (another phone or a security key). This way you're never locked out.

Step 4: Register a Backup Passkey

  1. Go back to "Password and authentication"
  2. Click "Register a new passkey" again
  3. Choose a different device (e.g., if you used your iPhone, use your Apple Watch or Android phone)
  4. Complete the registration

Step 5: Keep Your Password (For Now)

  1. GitHub still requires a password for recovery and CLI access
  2. Make sure your password is strong (16+ characters)
  3. You can change it in the same "Password and authentication" section
  4. Consider using a password manager to generate and store it
Note: GitHub hasn't made passkeys completely passwordless yet. You still need a password for recovery, but it's no longer used for regular sign-ins.

Step 6: Enable Passkey-Only Login (Optional)

  1. Once you have passkeys set up, go to "Password and authentication"
  2. Look for "Passkey-only sign-in" option
  3. If available, enable it to disallow password-based sign-in entirely
  4. This provides maximum security but requires passkeys for everything

Signing In With Your Passkey

After setup, signing into GitHub is simple:

  1. Visit github.com
  2. Enter your GitHub username/email
  3. Instead of a password field, click "Sign in with passkey"
  4. Your browser will ask for biometric authentication
  5. Use Face ID, fingerprint, or your security key
  6. You're logged in instantly

CLI Authentication With Passkeys

Important: GitHub CLI (`gh`) doesn't yet support passkey authentication. You'll need to use Personal Access Tokens (PATs) for command-line access.

  1. Go to Settings β†’ Developer settings β†’ Personal access tokens
  2. Create a new token with `repo` scope
  3. Save this token in your password manager
  4. Use this token instead of your password for CLI authentication
Pro tip: Store your PAT in a password manager and use `gh auth login` to authenticate your CLI. Never paste your token directly into commands.

What If You Lose Your Passkey?

If you lose your phone or security key:

This is why registering backup passkeys is crucial.

Security Considerations

Phishing Protection

Passkeys are bound to github.com. Even if you visit a phishing site that looks identical to GitHub, your passkey won't authenticate. This prevents one of the most common attack vectors.

No Password Reuse

Since you don't have a GitHub password to remember, there's no temptation to reuse it elsewhere. Each account gets its own security model.

Biometric Security

Your biometric (Face ID, fingerprint) is processed locally on your device and never sent to GitHub. It's the most secure authentication method available.

Next Steps

After securing GitHub with passkeys:

Learn more about FIDO2 and passwordless authentication β†’

Related Articles

FIDO2 & Passwordless Authentication Explained

Understand how passkeys work and why they're the future.

Passkeys vs Password Managers

When to use passkeys and when to use a password manager.

How to Create a Truly Strong Password

For accounts that don't support passkeys yet.