Search tools, AI agents, MCP servers
Submit a tool

Search iThub

Search tools, categories and collections. Type at least two characters.

Explore all tools
↑ ↓ to explore resultsEnter to open · Esc to close

Version Control & Code Hosting

Support for password authentication was removed: how to fix Git

Why GitHub rejects your Git password since August 13, 2021, and how to fix it with a personal access token, SSH key, Git Credential Manager or the gh CLI.

iThub Insights cover: How-to, Fix the Git password authentication error, with the iThub logo tile

At a glance

Where it appears
Git over HTTPS to GitHub.com
Since
August 13, 2021, 09:00 PST
Cause
Git sent an account password where GitHub expects a token
Quickest fix
gh auth login or Git Credential Manager
Lasting options
Fine-grained token, SSH key, OAuth credential helper
Other forges
Bitbucket Cloud now requires API tokens; GitLab and Codeberg require tokens once 2FA is on
On this page
  1. Why did GitHub stop accepting passwords for Git?
  2. How do you fix it in 5 minutes?
  3. Which authentication method should you use?
  4. How do personal access tokens work now?
  5. How do you set up SSH keys for Git?
  6. What do Git Credential Manager and the GitHub CLI do?
  7. Which credential helper does each operating system use?
  8. How should CI and servers authenticate?
  9. Does the same error happen on GitLab, Bitbucket and Codeberg?
  10. How do you keep tokens and keys safe?
  11. Sources

"Support for password authentication was removed" means Git sent your GitHub account password, and GitHub.com has refused account passwords for Git operations since August 13, 2021. Your repository is fine. Git needs a different credential: a personal access token entered at the password prompt, an SSH key, or a credential helper such as Git Credential Manager or the GitHub CLI that signs you in through the browser and keeps a token for you (GitHub Blog).

The message usually looks like this:

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/... for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/OWNER/REPO.git/'

Why did GitHub stop accepting passwords for Git?

GitHub announced the plan in July 2020 and published the timeline on December 15, 2020. Password authentication was switched off for a few hours during two brownouts, on June 30 and July 28, 2021, and removed for good on August 13, 2021 at 09:00 PST (GitHub Changelog). The rule covers command-line Git, desktop apps that run Git and any app or service that reached GitHub.com repositories with an account password. Accounts with two-factor authentication were already limited to tokens and SSH keys.

GitHub gave four reasons for preferring tokens. A token is unique to GitHub and can be created per device or per use. It can be revoked on its own without changing anything else. It can be limited to the access one job needs. And it is random, so dictionary and brute force attacks do not apply.

Why the error still shows up years later

The cutoff is old, but the error keeps appearing:

  • A credential helper or an old script still holds your account password and sends it without asking.
  • A remote URL has the password embedded, as in https://user:password@github.com/....
  • On a new machine, Git printed Password for 'https://...' and you typed your account password. GitHub expects a personal access token at that prompt (GitHub Docs).

If you are certain you entered a token, check that it still exists and has not expired. A token GitHub rejects can trigger the same message.

How do you fix it in 5 minutes?

Every method below works on all three systems. The per-system routes are simply the ones that need the fewest installs.

First, on any system

  1. Run git remote -v. If the URLs start with git@github.com:, that remote uses SSH and is not the source of this error. If they start with https://github.com/, carry on.
  2. Remove the saved GitHub password so no helper replays it. On Windows, run this in Git Bash, which comes with Git for Windows:
printf "protocol=https\nhost=github.com\n\n" | git credential reject

git credential reject hands that description to every configured helper, and each one erases matching credentials it has stored (Git documentation).

macOS: sign in with the GitHub CLI

  1. Install the CLI with Homebrew: brew install gh.
  2. Run gh auth login --hostname github.com --git-protocol https --web. Copy the one-time code it prints, paste it in the browser page that opens and approve.
  3. When asked whether to authenticate Git with your GitHub credentials, answer yes. If you skipped that question, run gh auth setup-git, which configures Git to use the CLI as its credential helper (GitHub CLI manual).
  4. Check the result with gh auth status, then run git push again.

Windows: use Git Credential Manager

  1. Install or update Git for Windows and keep Git Credential Manager selected as the credential helper during setup. It ships inside the installer (GCM install guide).
  2. In PowerShell, make sure it is the active helper: git config --global credential.helper manager.
  3. Run git fetch or git push. A browser window opens. Sign in to GitHub, complete your second factor and authorize the app.
  4. GCM saves the resulting token in Windows Credential Manager, so later pushes do not prompt.

Linux: switch the remote to SSH

  1. Create a key: ssh-keygen -t ed25519 -C "you@example.com". Accept the default path and set a passphrase.
  2. Load it into the agent: eval "$(ssh-agent -s)", then ssh-add ~/.ssh/id_ed25519.
  3. Print the public key with cat ~/.ssh/id_ed25519.pub and paste it into GitHub under Settings, SSH and GPG keys, New SSH key.
  4. Test the connection with ssh -T git@github.com. GitHub answers with a greeting that names your account and says it does not provide shell access.
  5. Point the repository at the SSH URL and push:
git remote set-url origin git@github.com:OWNER/REPO.git
git push

If you cannot install anything, a fine-grained personal access token works with the Git you already have: create one, then paste it at the password prompt.

Which authentication method should you use?

For a personal machine, SSH or an OAuth helper (GCM or the GitHub CLI) is the least maintenance. Tokens suit scripts and one-off access. Automation should use credentials that belong to a repository or an app rather than to a person.

Method Best for Where the secret lives Expiry and rotation Works with 2FA
Account password Nothing; GitHub.com rejects it for Git n/a n/a No
Fine-grained personal access token Scripts and HTTPS access to selected repositories of one owner Your credential helper or a CI secret You set an expiry; organizations can cap it Yes
Classic personal access token Cases fine-grained tokens do not cover yet Your credential helper or a CI secret Optional expiry; GitHub removes tokens unused for a year Yes
SSH key Daily work on your own machines ~/.ssh, loaded into ssh-agent or the macOS keychain No expiry; remove and replace by hand Yes
Git Credential Manager HTTPS without handling tokens yourself OS credential store Sign in again in the browser when the token stops working Yes, 2FA happens in the browser
GitHub CLI (gh) People who already use gh System credential store, or a plain-text file if none exists gh auth logout or revoke the app Yes, 2FA happens in the browser
Deploy key A server that pulls one repository Private key on that server No expiry; tied to the repository Not tied to a user
GITHUB_TOKEN GitHub Actions jobs in the same repository Generated for each job Expires when the job finishes Not tied to a user
GitHub App installation token Automation across many repositories Minted on demand from the app's private key Expires after one hour Not tied to a user

How do personal access tokens work now?

GitHub offers two kinds (GitHub Docs):

  • Fine-grained tokens Belong to one resource owner, a user or an organization, and can be limited to selected repositories and individual permissions. For Git, the permission that matters is Contents: read for clone and pull, read and write for push. Every fine-grained token also has read-only access to all public repositories.
  • Classic tokens Use broad scopes. The repo scope opens every repository you can reach, including those of every organization you belong to. GitHub calls them less secure and keeps them for the gaps fine-grained tokens still have: contributing to public repositories you are not a member of, working as an outside collaborator, reaching several organizations with one token, and GitHub Packages.

Create a fine-grained token under Settings, Developer settings, Personal access tokens, Fine-grained tokens. Pick the resource owner, choose Only select repositories, grant Contents, and set an expiry. GitHub allows tokens without an expiry unless a policy blocks them, but it recommends setting one, and it deletes tokens that have gone unused for a year.

How do you set up SSH keys for Git?

GitHub's SSH guide generates Ed25519 keys and falls back to ssh-keygen -t rsa -b 4096 only for systems that cannot create them. DSA keys are no longer accepted (GitHub Docs). A passphrase protects the key if the file leaks, and the agent saves you from typing it on every push.

On macOS, a short entry in ~/.ssh/config loads the key into the agent and stores the passphrase in the keychain:

Host github.com
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id_ed25519

Then add the key once with Apple's own ssh-add:

ssh-add --apple-use-keychain ~/.ssh/id_ed25519

On Windows, start the OpenSSH agent from an administrator PowerShell, add the key from a normal one and tell Git to use the Windows SSH client so it talks to that agent:

Get-Service -Name ssh-agent | Set-Service -StartupType Manual
Start-Service ssh-agent
ssh-add $env:USERPROFILE\.ssh\id_ed25519
git config --global core.sshCommand "C:/Windows/System32/OpenSSH/ssh.exe"

Two more ~/.ssh/config patterns solve common problems. A host alias lets one machine use separate keys for a personal and a work account; clone with git@github-work:ORG/REPO.git and SSH picks the work key:

Host github-work
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_ed25519_work
  IdentitiesOnly yes

If a firewall blocks port 22, GitHub accepts SSH on port 443 at ssh.github.com. Test it with ssh -T -p 443 git@ssh.github.com, then make it permanent (GitHub Docs):

Host github.com
  Hostname ssh.github.com
  Port 443
  User git

What do Git Credential Manager and the GitHub CLI do?

Both keep you on HTTPS and replace the password prompt with a browser sign-in, so you never copy a token by hand.

Git Credential Manager works with GitHub, GitLab, Bitbucket and Azure DevOps on Windows, macOS and Linux. It handles HTTPS remotes only, not SSH. For GitHub it can sign in through a browser window, which needs a desktop, or, where there is no desktop, with a device code you approve from any browser. On macOS install it with brew install --cask git-credential-manager; on Linux use the .NET tool, the .deb package or the tarball, then run git-credential-manager configure. Linux needs one more decision, because GCM has no default store there (GCM credential stores):

git config --global credential.credentialStore secretservice

Use secretservice on desktops with GNOME Keyring or KWallet, gpg on servers with pass set up, and cache to keep credentials in memory only. The plaintext option exists, and GCM's own documentation warns against it.

The GitHub CLI stores its token in the system credential store and falls back to a plain-text file when it cannot find one; gh auth status shows which (GitHub CLI manual). After gh auth setup-git, Git asks gh for credentials whenever it talks to GitHub, which suits people who already use gh for pull requests and releases.

Which credential helper does each operating system use?

A credential helper is the program Git asks for a username and password before it prompts you. Git documents these options (Git documentation):

  • macOS osxkeychain saves credentials in the login keychain. Apple's Git and Homebrew's Git usually enable it already.
  • Windows manager is Git Credential Manager, bundled with Git for Windows. wincred is a simpler helper that also uses Windows Credential Manager.
  • Linux libsecret talks to GNOME Keyring or KWallet. Some distributions package it; elsewhere it has to be built from Git's contrib folder. GCM with secretservice reaches the same store.
  • Any system cache keeps credentials in memory for a limited time, for example git config --global credential.helper 'cache --timeout=3600'.

Avoid store. It writes every credential to ~/.git-credentials as a line such as https://user:token@github.com, unencrypted and protected only by file permissions (git-credential-store). Anyone who copies your home directory, a backup or a dotfiles repository gets the token.

To see which helpers are active and which file set them, run:

git config --show-origin --get-all credential.helper

How should CI and servers authenticate?

Do not put a personal token on a shared server or in a pipeline if something narrower exists. A personal token acts as you, across every repository it can reach, until someone remembers to delete it.

  • GITHUB_TOKEN Is created for each GitHub Actions job as a GitHub App installation token. Its permissions are limited to the repository that runs the workflow, and it expires when the job finishes (GitHub Docs). Raise permissions per job with the permissions key, for example contents: write for a job that pushes.
  • Deploy keys Are SSH keys attached to a single repository, read-only by default with optional write access. One key cannot serve two repositories, keys never expire and they usually have no passphrase, so a compromised server exposes them (GitHub Docs).
  • GitHub App installation tokens Are the better fit for automation across many repositories. The app defines exact permissions, tokens can be narrowed to specific repositories and expire after one hour, and they do not use a licensed seat.

Does the same error happen on GitLab, Bitbucket and Codeberg?

The message text is GitHub's, but every major forge has moved Git over HTTPS toward tokens.

GitLab

GitLab requires a personal access token for Git over HTTPS once two-factor authentication or SAML is enabled on the account (GitLab Docs). Give it read_repository to clone and pull and write_repository to push. Without a date you choose, a token expires after 365 days, which is also the default maximum; administrators on GitLab 17.6 and later can change that limit. For automation, GitLab adds project and group access tokens, which act through a bot user (on GitLab.com, project access tokens need Premium or Ultimate), and deploy tokens, which work over HTTPS only and can clone but never push. GCM also handles GitLab sign-in through the browser.

Bitbucket Cloud

Bitbucket Cloud stopped accepting Atlassian account passwords for Git over HTTPS on March 1, 2022 and moved users to app passwords (Atlassian). Those are now going too: creation of new app passwords ended on September 9, 2025 (Atlassian), brownouts ran from June 9 to July 28, 2026, and after July 28, 2026 app passwords no longer work (Atlassian Support). The replacement is an API token with scopes, created in your Atlassian account security settings with Bitbucket selected as the app. Git needs read:repository:bitbucket to clone and write:repository:bitbucket to push (Atlassian Support).

Gitea, Forgejo and Codeberg

Gitea and Forgejo create access tokens under Settings, Applications. Codeberg, which runs Forgejo, still asks for your username and password over HTTPS, but once two-factor authentication is on you enter an access token instead (Codeberg Docs). Forgejo tokens can be limited to specific repositories with read:repository or write:repository, so a token for one project cannot touch the rest of your account (Forgejo Docs). Forgejo also registers Git Credential Manager and git-credential-oauth as OAuth apps on the server side, so either helper can sign in through the browser once installed on your machine.

How do you keep tokens and keys safe?

  • Never put a token in a URL. git clone https://user:TOKEN@github.com/... saves the token in .git/config as part of the remote URL, and it also lands in your shell history and in any log that prints the command. Let a credential helper hold it.
  • Grant the least privilege that works. One fine-grained token per job, limited to the repositories it needs, with an expiry date. On GitLab and Forgejo, pick the narrowest scope.
  • Treat a leaked token as compromised. Revoke it first, then create a replacement and update whatever used it. Check your account's security log for activity you do not recognize, and scan the repository history with a secret scanner such as TruffleHog, because removing a token in a later commit leaves it in earlier ones.
  • Protect SSH keys. Use a passphrase, remove keys you no longer use from every forge account, and replace a key whenever a laptop is lost or retired.
  • Turn on two-factor authentication On every forge account. Tokens, SSH keys and the OAuth helpers all keep working with it.
  • Store a token you have to re-enter in a password manager , such as KeePassXC or one of the options in our guide to self-hosted password managers, rather than in a notes file.

To compare hosting platforms, see GitHub and the rest of the version control and code hosting category in the iThub directory.

Sources

Frequently asked questions

Can I still use my GitHub password anywhere?

Yes, to sign in to github.com in a browser, where GitHub then asks for your second factor. Git over HTTPS needs a token or a helper that fetches one for you. GitHub Desktop signs in through the browser on its own and was never affected by the change.

Why does Git still fail after I created a token?

Check what the token can reach. A fine-grained token only covers the resource owner and repositories you picked, so a repository in another organization fails. If that organization requires approval, the token stays limited to public resources until an owner approves it. Organizations that use SAML single sign-on also require you to authorize a classic token for them before it works.

Should I use HTTPS or SSH for Git?

Both are fine. HTTPS passes through most corporate proxies and pairs well with Git Credential Manager, which renews access through a browser sign-in. SSH avoids token expiry altogether and suits machines you control. Many people use SSH on their own laptops and HTTPS with short-lived tokens in automation.

What username goes with a token?

On GitHub, enter your GitHub username and paste the token as the password. GitLab accepts any non-empty username with a personal or project access token. Bitbucket Cloud accepts your Bitbucket username, which is case sensitive, or the static username x-bitbucket-api-token-auth with an API token.

What happens to my clones when a token expires?

Nothing changes in the repositories themselves. The next fetch or push fails with an authentication error, and once you create a new token and enter it at the prompt, your credential helper replaces the old one. There is no need to clone again or edit remotes, unless the old token was embedded in a remote URL.

Can I use one SSH key for GitHub, GitLab and Bitbucket?

Yes, a public key can be added to accounts on several forges, and the same private key then works for all of them. Separate keys per forge or per machine make revocation simpler, because losing one laptop means removing one key rather than rotating access everywhere. Deploy keys are different: GitHub ties each one to a single repository.

Tools in this article

  1. GitLabDevSecOps platform with Git repositories, merge requests, CI/CD, security scanning and planningVersion Control & Code Hosting38 views
  2. BitbucketGit hosting and Pipelines from AtlassianVersion Control & Code Hosting20 views
  3. GiteaSelf-hosted Git service with code review, issues, package registries and GitHub Actions compatible CI/CDVersion Control & Code Hosting4 views
  4. ForgejoSelf-hosted Git forge with code review, issues, package registry and Actions CI, stewarded by Codeberg e.V.Version Control & Code Hosting0 views
  5. TruffleHogOpen-source scanner that finds, classifies and verifies leaked credentials across Git, cloud storage, images and CISecrets Management2 views
  6. KeePassXCOffline, open-source password manager with KDBX 4 databases, passkeys, TOTP and SSH agent supportPassword Managers3 views
  7. GitHubGit hosting with pull requests, Actions CI/CD, Copilot, Codespaces and a self-hosted Enterprise ServerVersion Control & Code Hosting73 views
Share this article

Facts link to their official sources. Product details can change after publication: report an error or read the editorial methodology.

Emanuel DE ALMEIDA

Written by

Emanuel DE ALMEIDA

Entrepreneur · IT consultant · Software creator

Geneva-based entrepreneur, IT consultant and creator of SuniPDF and SuniCapture. Emanuel shares practical IT, cybersecurity and software insights on iThub.

Keep reading

More guides and analysis from the iThub editors.

All insights
What is a knowledge graph? A guide for developers and AI buildersA knowledge graph stores entities as nodes and relationships as edges, with a schema that gives them meaning. RDF vs property graphs, SPARQL, Cypher, GraphRAG.What is containerization? How containers work, from kernel to registryWhat containerization is and how containers work: namespaces, cgroups v2, image layers, OCI specs, runtimes, rootless, macOS and Windows, with a Dockerfile.REA: reverse engineering with AI agents, evidence and local analysis toolsHow REA connects AI agents to local reverse-engineering tools, what targets it supports, how evidence is returned, and the legal and security limits to assess.