Skip to content
FR
  1. LuzineDebug
  2. Git & GitHub
  3. remote: Support for password authentication was…
Git & GitHub Beginner ≈ 10 min to fix

Fix "Support for password authentication was removed" on GitHub

Error message
remote: Support for password authentication was removed on August 13, 2021.
fatal: Authentication failed for 'https://github.com/user/repo.git/'
  • remote: Invalid username or token. Password authentication is not supported for Git operations.
  • remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/user/repo.git/'
  • fatal: could not read Username for 'https://github.com': terminal prompts disabled
  • remote: Permission to user/repo.git denied to other-user. fatal: unable to access 'https://github.com/user/repo.git/': The requested URL returned error: 403
In short

GitHub no longer accepts your account password for git push or git pull over HTTPS. Sign in with gh auth login or Git Credential Manager, or create a personal access token to use instead of the password; you can also switch to SSH.

Be the first to confirm this fix

What this error means

Since 13 August 2021, GitHub rejects username and password authentication for every Git operation over HTTPS. When Git asks for "Password", you must provide a personal access token or let a credential manager run an OAuth sign-in in the browser. The message appears if you type your password, or if an old password is still stored in the macOS Keychain, the Windows Credential Manager or a ~/.git-credentials file. A 403 "Permission denied to other-user" error rather means a credential for another account is stored.

Common causes

  1. Account password typed at the "Password for https://github.com" prompt instead of a token.
  2. Old credential stored in the Keychain, the Windows Credential Manager or ~/.git-credentials, which Git sends automatically.
  3. Token expired, revoked or missing the right permissions (no access to the repository, no write permission on Contents).
  4. Organisation with SSO: the token has not been authorised for the organisation.

Step-by-step fix

  1. Check the repository URL

    If the URL starts with https://, authentication goes through a token or a credential manager. If you see a password or token inside the URL, remove it (see the "Clean up" step).

    bash
    git remote -v
  2. Easy fix: GitHub CLI

    gh auth login opens a sign-in in the browser. Choose HTTPS and agree to authenticate Git with your GitHub credentials: gh becomes Git’s credential helper. Works on Windows, macOS and Linux.

    bash
    gh auth login
    gh auth setup-git
    git push
  3. Alternative: Git Credential Manager

    It ships with Git for Windows. On macOS, install it with Homebrew; on Linux, it is available as a .deb package or a tarball. On the next push, a GitHub sign-in window opens and the token is stored securely.

    bash
    # macOS
    brew install --cask git-credential-manager
    git credential-manager configure
    git push
  4. Or create a personal access token

    GitHub > Settings > Developer settings > Personal access tokens > Fine-grained tokens > Generate new token. Limit it to the repositories you need, grant Contents Read and write, and set an expiry date. On the next git push, type your GitHub username, then paste the token as the password. Treat it like a password: never commit it or paste it into a chat.

  5. Clean up old credentials

    Delete the stored credential so Git asks you to sign in again. The git credential reject command works with the configured helper (macOS, Linux, Windows). On Windows, you can also open Credential Manager > Windows Credentials and remove git:https://github.com. Also remove any token written in the repository URL.

    bash
    printf "protocol=https\nhost=github.com\n\n" | git credential reject
    git remote set-url origin https://github.com/user/repo.git
  6. Alternative: switch to SSH

    With an SSH key added to your account, no typing is needed. Test the key with ssh -T [email protected] before pushing.

    bash
    git remote set-url origin [email protected]:user/repo.git
    ssh -T [email protected]
    git push

Did this fix work for you?

Confirm it in one click: it will rise for the next developers stuck on the same error.

Keep it from coming back

  • Use a credential manager (gh, Git Credential Manager, Keychain) rather than credential.helper store, which saves the token in plain text in ~/.git-credentials.
  • Never put a token in the repository URL: it ends up in plain text in .git/config, the shell history and sometimes CI logs.
  • Pick fine-grained tokens with an expiry date, and note when to renew them.

Frequently asked questions

What goes in "Username" and "Password"?

Username: your GitHub username. Password: the personal access token, not your account password. The token does not show while you type, that is normal.

What about GitHub Actions or another CI?

In GitHub Actions, use the automatically provided GITHUB_TOKEN. Elsewhere, store a dedicated token in the CI secrets, with the minimum permissions.

Classic token or fine-grained token?

Prefer fine-grained: it is limited to specific repositories and permissions. A classic token with the repo scope gives access to all your repositories; keep it for tools that do not support fine-grained tokens yet.

Useful tools for this error

More Git & GitHub errors

All Git & GitHub errors →