How to fix remote: Support for password authentication was removed. Please use a personal access token instead. in Git
GitHub no longer accepts account passwords for Git operations over HTTPS. Since August 2021, you must use a personal access token or SSH key to authenticate instead of your password.
Quick fix
Fixes remote: Support for password authentication was removed. Please use a personal access token instead.
# Your token will look something like this:
ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx- Generate a Personal Access Token on GitHub
- Update cached credentials on your system
- Use the token when Git prompts for password
- Configure Git to cache credentials (optional)
# Your token will look something like this:ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxremote: Support for password authentication was removed. Please use a personal access token instead.
What this error means
This error occurs because GitHub removed support for password-based authentication for Git operations on August 13, 2021. When you try to push, pull, clone, or fetch from a GitHub repository using HTTPS and enter your account password, GitHub rejects the authentication. This security change was announced by GitHub in July 2020 to encourage the use of more secure authentication methods. Personal access tokens and SSH keys provide better security because they can be scoped to specific permissions, easily revoked, and are not susceptible to password-based attacks. The error is returned by GitHub's servers (indicated by "remote:") when they detect an attempt to authenticate with a password rather than a token.
Typical symptoms
- Git push, pull, clone, or fetch operations fail with authentication error
- Error message appears when using HTTPS remote URL with password
- Previously working Git commands suddenly stop working
- CI/CD pipelines fail with authentication errors after August 13, 2021
- Credential managers prompt for password but authentication still fails
Common causes
- GitHub deprecated password authentication for Git operations on August 13, 2021
- Using a cached password in credential manager instead of a personal access token
- Git remote URL is configured for HTTPS but using password instead of token
- Personal access token has expired or been revoked
- Token does not have the required scopes for the Git operation
How to fix "remote: Support for password authentication was removed. Please use a personal access token instead."
1. Log into GitHub and click your profile picture, then select Settings
2. In the left sidebar, scroll down and click Developer settings
3. Click Personal access tokens > Tokens (classic)
4. Click Generate new token > Generate new token (classic)
5. Add a descriptive note (e.g., "Git CLI access")
6. Set an expiration (or "No expiration" for long-lived tokens)
7. Select scopes - for typical Git operations, check:
- repo (Full control of private repositories)
- workflow (if you work with GitHub Actions)
8. Click Generate token
9. Copy the token immediately - you won't be able to see it again
# Your token will look something like this:
ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxRemove old cached passwords so Git prompts for the new token.
macOS (Keychain Access):
# Option 1: Use command line
git credential-osxkeychain erase
host=github.com
protocol=https
# Press Enter twice
# Option 2: Open Keychain Access app, search for "github.com", delete the entryWindows (Credential Manager):
1. Open Control Panel > Credential Manager
2. Click Windows Credentials
3. Find entries for git:https://github.com or github.com
4. Click the entry and select Remove
Linux (Git Credential Cache):
# Clear cached credentials
git credential reject
host=github.com
protocol=https
# Press Enter twice
# Or remove the credential helper cache file
rm ~/.git-credentialsThe next time you run a Git command that requires authentication, enter your credentials:
git push origin main
# Username: your-github-username
# Password: ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # Paste your token hereImportant: When prompted for a "password", paste your personal access token, not your GitHub account password.
To avoid entering the token repeatedly, configure a credential helper:
macOS (uses Keychain):
git config --global credential.helper osxkeychainWindows (uses Credential Manager):
git config --global credential.helper managerLinux (cache in memory for 1 hour):
git config --global credential.helper 'cache --timeout=3600'Linux (store permanently in file):
git config --global credential.helper store
# Note: This stores credentials in plain text at ~/.git-credentialsSSH keys are another secure authentication method that doesn't require tokens:
# Check for existing SSH keys
ls -la ~/.ssh
# Generate a new SSH key (if needed)
ssh-keygen -t ed25519 -C "your_email@example.com"
# Start the SSH agent and add your key
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
# Copy the public key
cat ~/.ssh/id_ed25519.pub
# Copy the outputAdd the key to GitHub:
1. Go to Settings > SSH and GPG keys
2. Click New SSH key
3. Paste your public key and save
Update your remote URL to use SSH:
# Check current remote
git remote -v
# Change from HTTPS to SSH
git remote set-url origin git@github.com:username/repository.gitAdvanced notes
### Token Scopes and Permissions
Personal access tokens use scopes to limit what they can do:
| Scope | Permission |
|-------|------------|
| repo | Full access to repositories (push, pull, etc.) |
| repo:status | Read/write commit status |
| public_repo | Access to public repositories only |
| workflow | Update GitHub Actions workflows |
For CI/CD systems, create dedicated tokens with minimal required scopes.
### Fine-Grained Personal Access Tokens
GitHub now offers fine-grained tokens that provide even more control:
- Scope access to specific repositories
- Set read-only vs read-write per permission type
- Require organization approval for certain actions
To create one: Settings > Developer settings > Personal access tokens > Fine-grained tokens
### Token Security Best Practices
1. Set expiration dates - Avoid "no expiration" when possible
2. Use minimal scopes - Only grant permissions you need
3. Rotate tokens regularly - Especially for CI/CD systems
4. Never commit tokens - Add .env files to .gitignore
5. Use environment variables - Store tokens in CI/CD secrets, not code
### GitHub CLI Alternative
The GitHub CLI (gh) can handle authentication automatically:
# Install and authenticate
gh auth login
# This configures Git to use gh as a credential helper
gh auth setup-git### Enterprise and Self-Hosted GitHub
If you use GitHub Enterprise Server, the deprecation timeline may differ. Check with your administrator. Some self-hosted instances may still support password authentication if configured.
Frequently asked questions
- What does "remote: Support for password authentication was removed. Please use a" mean?
- This error occurs because GitHub removed support for password-based authentication for Git operations on August 13, 2021. When you try to push, pull, clone, or fetch from a GitHub repository using HTTPS and enter your account password, GitHub rejects the authentication. This security change was announced by GitHub in July 2020 to encourage the use of more secure authentication methods.
- How do I fix "remote: Support for password authentication was removed. Please use a"?
- GitHub no longer accepts account passwords for Git operations over HTTPS. Since August 2021, you must use a personal access token or SSH key to authenticate instead of your password.
- What causes "remote: Support for password authentication was removed. Please use a"?
- GitHub deprecated password authentication for Git operations on August 13, 2021 Using a cached password in credential manager instead of a personal access token Git remote URL is configured for HTTPS but using password instead of token
- Is the "remote: Support for password authentication was removed. Please use a" error serious?
- It is a medium-severity error โ more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- ๐Git Official Documentation
- ๐
- ๐