GrepBoard/Manuals
605 manuals ·

Fix GitHub Support for password authentication was removed

·Tested on Ubuntu 24.04 (Docker) · git 2.43.0 · GitHub official docs · 2026-10·Test scope ↓·6 steps

GitHub Support for password authentication was removed: Git sent your password over HTTPS. Use a personal access token and erase the saved old password.

output
remote: Support for password authentication was removed on August 13, 2021.remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.fatal: Authentication failed for 'https://github.com/…/'

GitHub rejected an HTTPS push or pull because Git sent your account password. Since August 13, 2021, GitHub no longer accepts account passwords for Git operations. Enter a personal access token (PAT) where Git asks for the password, sign in through a credential manager or GitHub CLI, or switch to SSH. If you already created a token and still see the error, Git is almost always resending an old password saved somewhere.

[1] Check the remote URL. If an old password is embedded in it, Git keeps using it even after you create a token.

console
$ git remote -vorigin	https://user1:old-password@github.com/example-user/app.git (fetch)origin	https://user1:old-password@github.com/example-user/app.git (push)$ git remote set-url origin https://github.com/example-user/app.git && git remote -vorigin	https://github.com/example-user/app.git (fetch)origin	https://github.com/example-user/app.git (push)

Remove the user:password@ part. That form sits in plain text in .git/config and easily leaks into shell history and CI logs. If the URL starts with git@github.com:, you're on SSH and this guide doesn't apply.

[2] Create a personal access token under Settings → Developer settings → Personal access tokens on GitHub.

TypeWhat git push/pull needs
Fine-grainedSelect the repositories, and set the Contents repository permission to read (pull) or read and write (push)
ClassicThe repo scope

For organization repositories, the organization may have to approve the token (a fine-grained token stays pending until an administrator reviews it). If the organization uses SAML SSO, authorize the token for that organization. Set an expiration date; when it expires, create a new token and replace it as in [3] and [4].

[3] Find and erase the saved old password. git credential fill shows exactly what Git will send next time. It prints the password, so don't run it where others can see your screen.

console
$ git config --show-origin --get-all credential.helperfile:/root/.gitconfig	store$ printf 'protocol=https\nhost=github.com\n\n' | git credential fillprotocol=httpshost=github.comusername=user1password=old-password

If password= is still the old password, Git sends it without asking, token or not. git credential reject tells every configured helper to erase the matching entry.

console
$ printf 'protocol=https\nhost=github.com\nusername=user1\n\n' | git credential reject; wc -c ~/.git-credentials0 /root/.git-credentials$ printf 'protocol=https\nhost=github.com\n\n' | GIT_TERMINAL_PROMPT=0 git credential fill; echo "exit=$?"fatal: could not read Username for 'https://github.com': terminal prompts disabledexit=128

Nothing is stored now, so Git wants to ask for a username (prompting is disabled here with GIT_TERMINAL_PROMPT=0, which is why it fails). If --show-origin lists manager or osxkeychain from a system config file, the same command reaches the Windows Credential Manager or macOS Keychain entry. On Windows, GitHub's docs also suggest deleting the GitHub entry under Control Panel → Credential Manager.

[4] Enter the token and choose how to store it. On the next push, put your GitHub username at Username and the token at Password. With a helper configured, Git stops asking after that.

HelperWhere it stores
store~/.git-credentials, in plain text — readable as-is, as the cat below shows
cacheMemory, gone after a timeout (cache --timeout=3600)
manager (Git Credential Manager)The OS credential store; also handles two-factor authentication
osxkeychainmacOS Keychain
console
$ cat ~/.git-credentialshttps://user1:old-password@github.com

That is the file before the erase in [3]. On shared servers, avoid store and use cache; it lives in memory, so Git asks again after git credential-cache exit or the timeout. On your own machine, GCM or gh auth login (GitHub CLI stores Git credentials when you pick HTTPS as the Git protocol) spares you from handling the token yourself.

[5] Or switch to SSH instead of a token. Add a key to your account, then change only the remote URL.

console
$ git remote set-url origin git@github.com:<account>/<repo>.git

If ssh -T git@github.com answers Permission denied (publickey) with your key, go to Fix GitHub Permission denied (publickey).

[6] If no prompt appears at all, check for a non-interactive environment. CI jobs, cron and IDE background tasks have no terminal and end like this.

console
$ GIT_TERMINAL_PROMPT=0 git ls-remote https://github.com/example-user/private-repo.git; echo "exit=$?"fatal: could not read Username for 'https://github.com': terminal prompts disabledexit=128

There, store the token in a helper ahead of time, or use the token the service provides (such as GITHUB_TOKEN in GitHub Actions). If authentication passes but the push is rejected with ! [rejected], it's a history problem — see Fix git push rejected.

Official references: GitHub changelog — Git password authentication is shutting down · About remote repositories — HTTPS · Managing your personal access tokens · Caching your GitHub credentials in Git · git-credential · git-credential-store · git-credential-cache

#git#github#personal-access-token#credential-helper