If Git is rejecting your push with "Support for password authentication was removed," it means GitHub no longer accepts your account password over an HTTPS remote. As of August 13, 2021, GitHub only accepts a personal access token in place of your password on HTTPS, or an SSH key. The quick fix: create a token on GitHub and paste it where Git asks for your password.
The full error
When you push or pull over an HTTPS remote and type your old account password, you get this:
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 for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/you/your-repo.git/'

The message can be a little misleading. Your username and the repository are fine. The only thing GitHub stopped accepting is the password part of HTTPS Basic auth. You have two real fixes, and which one you want depends on how you cloned the repo.
Which remote are you using?
Check before you do anything else:
git remote -vorigin https://github.com/you/your-repo.git (fetch)
origin https://github.com/you/your-repo.git (push)If the URL starts with https://, you are on the HTTPS path and need a personal access token (the next section). If it starts with git@github.com:, you are on SSH, and this particular error does not apply to you. For the full trade-off between the two, see Git SSH vs HTTPS remotes.
Fix 1: Use a personal access token (keep HTTPS)
This is the smallest change. You keep your HTTPS remote and swap the password for a token.
Create the token
- On GitHub, go to Settings, Developer settings, Personal access tokens.
- Create a token (a fine-grained token scoped to the repos you push to is the modern choice; a classic token with the
reposcope also works). - Set an expiry and copy the token immediately. GitHub shows it once.
Use it
When Git prompts for credentials, your username is your GitHub username and your password is the token:
git push origin mainUsername for 'https://github.com': you
Password for 'https://you@github.com': ghp_xxxxxxxxxxxxxxxxxxxxPaste the token at the password prompt. The push goes through. If you have no terminal prompt (for example a GUI client), put the token directly in the URL the first time:
git remote set-url origin https://you@github.com/you/your-repo.gitGit will still ask for the password, which is the token.
Stop being asked every time
Typing a token on every push gets old fast. Tell Git to cache or store it with a credential helper.
On macOS, use the Keychain helper, which stores the token securely:
git config --global credential.helper osxkeychainOn Windows, Git for Windows ships with the Git Credential Manager, which handles this for you and is usually already enabled. On Linux, you can cache the token in memory for a session:
git config --global credential.helper 'cache --timeout=3600'The first push after setting a helper will ask for the token once, then reuse it. If you previously saved your old password, clear it first so Git stops trying the dead credential:
git credential reject
protocol=https
host=github.comPress Enter on the blank line after the last field. Then push again and supply the token.
Fix 2: Switch the remote to SSH
If you would rather not manage tokens at all, move the remote to SSH. You authenticate with a key on your machine instead of a typed secret, and the password-removed error stops being relevant.
First, if you do not have a key yet, generate an SSH key on Linux, macOS, or Windows, then add an SSH key to your GitHub account. Then point the existing remote at the SSH URL:
git remote set-url origin git@github.com:you/your-repo.git
git remote -vorigin git@github.com:you/your-repo.git (fetch)
origin git@github.com:you/your-repo.git (push)Verify the key is recognised:
ssh -T git@github.comHi you! You've successfully authenticated, but GitHub does not provide shell access.That message is success, not an error. Push as usual; there is no password prompt. If SSH itself fails with a publickey error, that is a separate problem covered in the Permission denied (publickey) fix.
Token or SSH: which should you pick?
| Personal access token (HTTPS) | SSH key | |
|---|---|---|
| Setup effort | Create token, paste once | Generate key, add to GitHub |
| Works behind strict firewalls | Yes (port 443) | Sometimes blocked (port 22) |
| Secret to manage | Token, with an expiry | Private key file on disk |
| Best for | Quick fix, locked-down networks, CI with a stored secret | Day-to-day work on a machine you own |
| Rotation | Token expires, regenerate | Key lives until you remove it |
For a laptop you control, SSH is the lower-friction long-term answer. For CI runners and machines where you want a scoped, expiring credential, a token is the better fit. If you are wiring up automation, the token model is exactly what powers wiring the token into a GitHub Actions deploy.
Why GitHub did this
Account passwords are reusable and often weak, and a leaked password hands over the whole account. A personal access token is scoped (you can limit it to specific repos and permissions) and expiring, so a leak is contained and time-boxed. SSH keys never travel over the wire as a typed secret at all. The change closed off the weakest link in the HTTPS flow. It is the same reasoning behind never letting credentials reach a public repo in the first place, which is its own can of worms if it happens: see how to remove a secret from Git history and why an exposed .git directory is dangerous.
Still stuck?
A few things that trip people up after applying the fix:
- You pasted the token but the prompt did not echo anything. That is normal; password fields are hidden. Paste and press Enter.
- It still fails with the old error. Git is reusing a cached password. Clear it with the
git credential rejectblock above (or delete thegithub.comentry from your OS keychain/credential manager) and try once more. - The token works in one repo but not another. A fine-grained token is scoped to specific repositories. Make sure the repo you are pushing to is in the token's allowed list.
- CI is failing. Store the token as a secret in your CI provider and reference it in the remote URL or a credential helper, never commit it.
If you are new to all of this, the Git for beginners guide walks through cloning, committing, and pushing from the start, and the git pull vs git fetch explainer covers the other half of talking to a remote.
Sources
Authoritative references this article was fact-checked against.
- GitHub Docs: Managing your personal access tokensdocs.github.com
- GitHub Docs: Caching your GitHub credentials in Gitdocs.github.com
- GitHub Docs: Connecting to GitHub with SSHdocs.github.com





